Commit 26c21669 by BellCodeEditor

save project

parent 026230d4
Showing with 2 additions and 2 deletions
......@@ -2,9 +2,9 @@ new_data=''
with open("C:\\Users\\Administrator\\Desktop\\捐赠明细.txt","r",encoding='utf-8') as p:
for data in p:
if '小强:10本'in data:
data=data.replace('小强数据在文件中')
data=data.replace('小强:10本','小强:11本')
if '小兰:12本' in data:
data=data.replace('小兰数据在文件中')
data=data.replace('小兰:12本','小兰:14本')
new_data +=data
with open("C:\\Users\\Administrator\\Desktop\\捐赠明细.txt","w",encoding='utf-8') as p:
p.write(new_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