From 2bcbd58f008af5c676fbf71290a84c2fa1a6fd21 Mon Sep 17 00:00:00 2001 From: frxz751113 <156018267+frxz751113@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:20:44 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E7=BD=91=E7=BB=9C=E6=94=B6=E9=9B=86.p?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- py/网络收集.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/py/网络收集.py b/py/网络收集.py index 1b58e40..9356ed4 100644 --- a/py/网络收集.py +++ b/py/网络收集.py @@ -487,15 +487,15 @@ print(f"有效的总行数为:{valid_line_count}") # 合并任意字符加上网络收集.txt 的文件 - all_files = [f for f in os.listdir(os.getcwd()) if f.endswith('网络收集.txt')] - with open(output_file_path, 'a', encoding='utf-8') as main_output: - for file_name in all_files: - if file_name!= output_file_path: - with open(file_name, 'r', encoding='utf-8') as other_file: - content = other_file.read() - if content: - main_output.write('\n') - main_output.write(content) +all_files = [f for f in os.listdir(os.getcwd()) if f.endswith('网络收集.txt')] +with open(output_file_path, 'a', encoding='utf-8') as main_output: + for file_name in all_files: + if file_name!= output_file_path: + with open(file_name, 'r', encoding='utf-8') as other_file: + content = other_file.read() + if content: + main_output.write('\n') + main_output.write(content) detected_ips = {} merge_and_filter()