From 8d4fb0f781be36e694fac8ba1e605a4d91e57ef9 Mon Sep 17 00:00:00 2001 From: frxz751113 <156018267+frxz751113@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:49:49 +0800 Subject: [PATCH] =?UTF-8?q?Update=20iptv=E6=B5=81=E7=95=85=E5=BA=A6?= =?UTF-8?q?=E6=A3=80=E6=B5=8B.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- py/iptv流畅度检测.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/py/iptv流畅度检测.py b/py/iptv流畅度检测.py index 7d46129..2f6202e 100644 --- a/py/iptv流畅度检测.py +++ b/py/iptv流畅度检测.py @@ -951,6 +951,20 @@ for file in files_to_remove: print(f"文件 {file} 不存在,跳过删除。") print("任务运行完毕,酒店源频道列表可查看文件夹内txt文件!") +#对生成的文件进行合并 +file_contents = [] +file_paths = ['酒店源.txt', "xx.txt"] # 替换为实际的文件路径列表 +for file_path in file_paths: + if os.path.exists(file_path): + with open(file_path, 'r', encoding="utf-8") as file: + content = file.read() + file_contents.append(content) + else: # 如果文件不存在,则提示异常并打印提示信息 + print(f"文件 {file_path} 不存在,跳过") +# 写入合并后的文件 +with open('酒店源.txt', "w", encoding="utf-8") as output: + output.write('\n'.join(file_contents)) + import cv2 import time