Btk is a little Python extension module allowing one to create and play with raw sockets and TCP/UDP/ICMP packets from within Python. It also has a nice and easy libpcap interface and good documentation.
af775caf35837b48d88412bc4f21fd450fd3cdbb2c63da952d0d7a5687189856