Commit ea08aa2b by BellCodeEditor

save project

parent ea647af9
Showing with 8 additions and 3 deletions
......@@ -6,7 +6,11 @@
# file1.write("小丽:11本\n")
# file1.write("李文:9\n")
# file1.close()
file1=open(r"C:\\Users\\Administrator\\Desktop","r",encoding="utf-8")
data=file1.read()
file1=open(r"C:\Users\Administrator\Desktop\book.txt","r",encoding="utf-8")
new_data=""
for data in file1:
print(data)
if "小兰:12本" in data:
data=data.replace("小丽:11本","小丽:14本")
new_data+=data
print(new_data)
file1.close()
\ 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