I was going through the Black Hat Python Book and, I tried the following piece of code, which sends an ICMP packet into the netwok to search for up hosts.
imp