How can I loop through an IP address range in python? Lets say I want to loop through every IP from 192.168.1.1 to 192.168. How can this be done?
You can use itertools.product:
for i,j in product(range(256),range(256)): print "192.168.{0}.{1}".format(i,j)