Commit 5e553df7 by BellCodeEditor

auto save

parent 70850cf8
Showing with 25 additions and 0 deletions
with open(r'C:\Users\yd\Desktop\锦瑟.txt','w',encoding='utf-8') as f1:
f1.write(' 锦瑟\n'
' [唐] 李商隐\n'
'锦瑟⽆端五⼗弦,\n'
'⼀弦⼀柱思华年。\n'
'庄⽣晓梦迷蝴蝶,\n'
'望帝春⼼托杜鹃。\n'
'沧海⽉明珠有泪,\n'
'蓝⽥⽇暖⽟⽣烟。\n'
'此情可待成追忆,\n'
'只是当时已惘然。\n')
new_date=[]
with open(r'C:\Users\yd\Desktop\锦瑟.txt','r',encoding='utf-8') as f2:
date = f2.readlines()
for i in date:
if '蓝⽥⽇暖⽟⽣烟。\n' == i:
new_date.append('________________。\n')
elif '此情可待成追忆,\n' == i:
new_date.append('________________,\n')
else:
new_date.append(i)
print(new_date)
with open(r'C:\Users\yd\Desktop\锦瑟.txt','w',encoding='utf-8') as f3:
f3.writelines(new_date)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment