Commit 026230d4 by BellCodeEditor

save project

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