Commit a672bc55 by BellCodeEditor

save project

parent 5e73a876
Showing with 2 additions and 2 deletions
...@@ -5,13 +5,13 @@ file.close() ...@@ -5,13 +5,13 @@ file.close()
new_file='小强:12本' new_file=''
with open(r'C:\Users\Administrator\Desktop\book.text','r',encoding='utf-8')as file: with open(r'C:\Users\Administrator\Desktop\book.text','r',encoding='utf-8')as file:
#file.write('小强:12本\n李明:15本\n') #file.write('小强:12本\n李明:15本\n')
for i in file: for i in file:
print(i) print(i)
if '小强:12本' in i: if '小强:12本' in i:
i=i.replace("小强:12本":"小强:14本") i=i.replace("小强:12本","小强:14本")
new_file+=i new_file+=i
print(new_file) print(new_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