未验证 提交 a83dbdd0 编写于 作者: N null 提交者: GitHub

Update IP_hosts_scan_multithreadingv2.0.py

上级 cdc8e518
......@@ -36,11 +36,7 @@ def host_check(host_ip):
success_list.append(info)
pbar.echo(info)
pbar.update_suc()
open('hosts_ok-ism.txt','a', encoding='utf-8').write(str(info)+'\n')
with open('hosts_ok.txt','a+') as f:
f.write(info.encode("utf-8") + "\n")
f.close()
open('hosts_ok-is.txt','a', encoding='utf-8').write(str(info)+'\n')
finally:
lock.release()
......@@ -72,7 +68,7 @@ if __name__ == '__main__':
original_sigint_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGINT, original_sigint_handler)
pool = Pool(40)
pool = Pool(20)
try:
pool.map_async(host_check, host_ip_list)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册