Commit dcaaee94 by BellCodeEditor

save project

parent b43589f5
Showing with 3 additions and 3 deletions
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
# data=data.replace(‘小强:10本’,‘小强:11本’) # data=data.replace(‘小强:10本’,‘小强:11本’)
# file.close() # file.close()
new_data='' new_data=''
with open(r"C:\Users\86139\Desktop\text.txt",'w',encoding='utf-8') as file: with open(r"C:\Users\86139\Desktop\text.txt",'r',encoding='utf-8') as file:
for data in file: for data in file:
if '小强:10本' in data: if '小强:12本' in data:
data=data.replace('小强:10本','小强:11本') data=data.replace('小强:12本','小强:11本')
if '小兰:12本' in data: if '小兰:12本' in data:
data=data.replace('小蓝:12本','小强:14本') data=data.replace('小蓝:12本','小强:14本')
new_data+=data new_data+=data
......
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