def hanshu(b):
print(b)
a="192.168.1.1-3"
for ip in a.split(','):
if '-' in ip:
s1, s2 = ip.rsplit('.', 1)
start, end = map(int, s2.split('-'))
for num in range(start, end+1):
b=s1+'.'+str(num)
hanshu(b)
else:
hanshu(ip)
Use this module, your code will not be so ugly, and
split(",") is written wrong
The threading module is used for multi-threading. I don’t quite understand what you want