Commit 52995567 by BellCodeEditor

save project

parent 04557266
Showing with 74 additions and 2 deletions
......@@ -10,4 +10,77 @@ with open("C:\\Users\\EDZ\\Desktop\\t.txt","r",encoding="utf-8") as f3:
for i in a:
if i =='小兰:10本':
print('找到了')
\ No newline at end of file
new_data=''
with open("C:\\Users\\EDZ\\Desktop\\t.txt","r",encoding="utf-8") as f1:
f = f1.read()
for data in f:
if '小兰:10本' in data:
data=data.replace('小兰:10本','小兰:11本')
new_data +=data
with open("C:\\Users\\EDZ\\Desktop\\t.txt","w",encoding="utf-8") as f1:
f1.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