If I think I know what you mean, this code should extract the parts of one line and iterate through a range of IP's, passing each one to a function I'm presuming you already have called "check_ip" which takes an IP in string format.
Code:parts = line.split(".") first_part = parts[:-1] last_part = parts[-1] the_range = last_part.split("-") bottom = the_range[0] top = the_range[1] for i in range(int(bottom), int(top)+1): ip = ".".join(first_part) + "." + str(i) check_ip(ip)




Reply With Quote