From a83dbdd0395d5d7eb2c238aeb92eca53161b969b Mon Sep 17 00:00:00 2001 From: null <50769953+test502git@users.noreply.github.com> Date: Sat, 30 Oct 2021 11:01:20 +0800 Subject: [PATCH] Update IP_hosts_scan_multithreadingv2.0.py --- IP_hosts_scan_multithreadingv2.0.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/IP_hosts_scan_multithreadingv2.0.py b/IP_hosts_scan_multithreadingv2.0.py index 3235603..3b8db15 100644 --- a/IP_hosts_scan_multithreadingv2.0.py +++ b/IP_hosts_scan_multithreadingv2.0.py @@ -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) -- GitLab