Commit cd9ed26f by BellCodeEditor

auto save

parent a8d02629
Showing with 11 additions and 0 deletions
new_date = ""
with open(r'C:\Users\70471\Desktop\text.txt','r',encoding='utf-8') as file1:
for i in file1:
if "小明:11本" in i:
i = i.replace("小明:11本","小明:10本")
print(i)
new_date += i
with open(r'C:\Users\70471\Desktop\text.txt','w',encoding="utf-8") as file1:
file1.write(new_date)
\ 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