Commit 00ecb65f by BellCodeEditor

auto save

parent de74fc1a
Showing with 1002 additions and 2 deletions
new_data=''
with open(r'c:\Users\CM\Desktop\text.txt','r',encoding='utf-8')as flle1: with open(r'c:\Users\CM\Desktop\text.txt','r',encoding='utf-8')as flle1:
for data in flle1: for data in flle1:
if'小强:10本'in data: if'小强:10本'in data:
print() data=data.replace('小强:10本','小强:11本')
\ No newline at end of file new_data+=data
with open(r'c:\Users\CM\Desktop\text.txt','w',encoding='utf-8')as flle1:
flle1.write(new_data)
\ 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