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()