Commit 3f50f548 by BellCodeEditor

save project

parent a8d02629
Showing with 10 additions and 0 deletions
new_date = ""
with open(r"C:\Users\aki\Desktop\book.txt","r",encoding="UTF-8") as file:
for i in file:
if "小强:12本" in i:
i = i.replace("小强:12本","小强:11")
print(i)
new_date += i
with open(r"C:\Users\aki\Desktop\book.txt","w",encoding="UTF-8") as file:
file.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