Commit 1494b15b by BellCodeEditor

save project

parent 7aaa1174
Showing with 9 additions and 5 deletions
new_data=''
with open(r"C:\Users\EDZ\Desktop\textgtfyfy.txt",'r',encoding='utf-8') as file:
for i in file:
if '小兰:12本'in i:
print("在")
for data in file:
if '小兰:12本' in data:
print("ddd")
data=data.replace("小兰:12本",'小兰:22本')
new_data+=data
with open(r"C:\Users\EDZ\Desktop\textgtfyfy.txt",'w',encoding='utf-8') as file:
file.write(new_data)
......@@ -4,6 +4,5 @@
张伟:16本
小强:15
小军:13
小强:15
小军:13
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