Created
August 16, 2016 15:33
-
-
Save coconut49/2a6300e899ee7e07f2e087040c4fe006 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import iptools | |
with open("chn.txt") as f,open("proxifier.txt",mode="w") as o: | |
line = f.readline() | |
while line: | |
ip,netmask = line.split(" ") | |
print("Now Processing IP: "+str(ip)+" Netmask: "+str(netmask)) | |
ipstart,ipend=iptools.ipv4.subnet2block(str(ip)+"/"+str(netmask)) | |
o.writelines(ipstart+"-"+ipend+"\n") | |
line = f.readline() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment