Update GAT.py
This commit is contained in:
@@ -716,6 +716,21 @@ file_path1 = '网络收集.txt'
|
|||||||
file_path2 = '综合源.txt'
|
file_path2 = '综合源.txt'
|
||||||
append_text_between_files(file_path1, file_path2)
|
append_text_between_files(file_path1, file_path2)
|
||||||
|
|
||||||
|
# 打开文档并读取所有行
|
||||||
|
with open('综合源.txt', 'r', encoding="utf-8") as file:
|
||||||
|
lines = file.readlines()
|
||||||
|
# 使用列表来存储唯一的行的顺序
|
||||||
|
unique_lines = []
|
||||||
|
seen_lines = set()
|
||||||
|
# 遍历每一行,如果是新的就加入unique_lines
|
||||||
|
for line in lines:
|
||||||
|
if line not in seen_lines:
|
||||||
|
unique_lines.append(line)
|
||||||
|
seen_lines.add(line)
|
||||||
|
# 将唯一的行写入新的文档
|
||||||
|
with open('综合源.txt', 'w', encoding="utf-8") as file:
|
||||||
|
file.writelines(unique_lines)
|
||||||
|
|
||||||
|
|
||||||
#TXT转M3U#
|
#TXT转M3U#
|
||||||
import datetime
|
import datetime
|
||||||
|
|||||||
Reference in New Issue
Block a user