Commit d54f9aa1 by BellCodeEditor

auto save

parent a8d02629
Showing with 10 additions and 0 deletions
data1=""
file1=open(r'C:\Users\孙斌\Desktop\book.txt','r',encoding='utf-8')
for data in file1:
if "小兰:12本" in data:
data=data.replace("小兰:12本","小兰:20本")
data1=data1+data
print(data1)
file1=open(r'C:\Users\孙斌\Desktop\book.txt','w',encoding='utf-8')
file1.write(data1)
file1.close()
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