国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

python – Ein Multithreading-Neuling m?chte fragen, wie man Multithread-Druck mit einer solchen IP implementieren kann?
PHPz
PHPz 2017-05-27 17:39:49
0
2
979
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)
PHPz
PHPz

學(xué)習(xí)是最好的投資!

Antworte allen(2)
黃舟
https://pypi.python.org/pypi/IPy/

使用這個模塊,你的代碼不會這么難看,而且
split(",") 寫錯了

黃舟

多線程要用的threading模塊吧,不是很明白你要什么

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage