From 23bddb3e66cd888d1930205e25798399c9690d33 Mon Sep 17 00:00:00 2001 From: frxz751113 <156018267+frxz751113@users.noreply.github.com> Date: Thu, 29 Aug 2024 02:33:15 +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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/网络收集.py b/py/网络收集.py index e65d155..339ce51 100644 --- a/py/网络收集.py +++ b/py/网络收集.py @@ -339,7 +339,7 @@ with open('2.txt', 'r', encoding='utf-8') as file: lines = file.readlines() # 创建或打开一个输出文件用于写入处理后的数据 - with open('3.txt', 'w', encoding='utf-8') as outfile: + with open('2.txt', 'w', encoding='utf-8') as outfile: for line in lines: # 首先检查行是否包含任何提取关键词 if any(keyword in line for keyword in extract_keywords): @@ -389,7 +389,7 @@ def parse_file(input_file_path, output_file_name): output_file.write(line + '\n') output_file.write('\n') # 在每个小段后添加一个空行作为分隔 # 调用函数并传入文件路径和输出文件名 -parse_file('3.txt', '2.txt') +parse_file('2.txt', '2.txt')