Commit 489c325b by BellCodeEditor

save project

parent a8d02629
Showing with 21 additions and 0 deletions
date=""
with open(r"C:\Users\Administrator\Documents\f.txt",'w',encoding='utf-8')as file:
file.write("小兰:12本")
file.write("小强:10本")
file.close()
with open(r"C:\Users\Administrator\Documents\f.txt",'r',encoding='utf-8')as file:
file.read()
for i in file:
if "小兰:12本" in file:
print("有小兰")
date=file.replace("10","11")
if "小强:10本" in file:
print("有小强")
date=file.replace("12","14")
with open(r"C:\Users\Administrator\Documents\f.txt",'w',encoding='utf-8')as file:
file.write(date)
with open(r"C:\Users\Administrator\Documents\f.txt",'r',encoding='utf-8')as file:
file.read()
print(date)
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