Commit e3dc6fe2 by BellCodeEditor

auto save

parent a986459f
Showing with 14 additions and 2 deletions
......@@ -3,4 +3,16 @@ file=open(r'D:\zm\张晓宇.text','w',encoding='utf-8')
file.write('小兰:12本、小丽:11本、李文:9本、张伟:16本\n')
with open(r'D:\zm\张晓宇.text','a',encoding='utf-8') as file:
file.write('小强:12本\n')
file.write('小张:15本\n')
\ No newline at end of file
file.write('小张:15本\n')
with open(r'D:\zm\张晓宇.text','r',encoding='utf-8') as file1:
new_data=""
for i in file1:
i=i.replace("小强:12本","小强:11本")
new_data+=i
with open(r'D:\zm\张晓宇.text','w',encoding='utf-8') as file1:
file1.write(new_data)
print(new_data)
\ 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