Commit b7da2500 by BellCodeEditor

save project

parent 18c357ec
Showing with 10 additions and 0 deletions
file2=""
with open(r"C:\Users\qinlp\Documents\test\book.txt","r", encoding="utf-8") as file:
for i in file:
if "小兰:12本" in i:
i=i.replace("小兰:12本","小兰:8848本")
print(i)
file2=file2+i
with open(r"C:\Users\qinlp\Documents\test\book.txt","w", encoding="utf-8") as file:
file.write(file2)
\ 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