def tansfile():
f1=open("文件1.txt", "r", encoding='utf-8') # 打开文件
with open("文件2.txt", 'w', encoding='utf-8') as f2:
for line in f1:
line=line.strip()
if (line.startswith("begin===")) or (line.startswith("end===")):
pass
else:
f2.write(line+'\n')
if __name__ == '__main__':
tansfile()
print("转换完成!")