Commit 89182947 by BellCodeEditor

save project

parent 57b537a8
Showing with 7 additions and 3 deletions
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
# ll.write('李文:9本\n') # ll.write('李文:9本\n')
# ll.write('张伟:16本\n') # ll.write('张伟:16本\n')
# ll.close() # ll.close()
w=''
with open(r"C:\Users\艾特机器人2号\Desktop\tv.txt",'r',encoding='utf-8') as ll: with open(r"C:\Users\艾特机器人2号\Desktop\tv.txt",'r',encoding='utf-8') as ll:
for data in ll: for data in ll:
if '小兰:12本'in data: if '小兰:12本' in data:
data.replace('小兰:12本','小兰:14本') data=data.replace('小兰:12本','小兰:14本')
\ No newline at end of file w+=data
with open(r"C:\Users\艾特机器人2号\Desktop\tv.txt",'w',encoding='utf-8') as ll:
ll.write(w)
\ 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