Commit b030739a by BellCodeEditor

save project

parent 9a982b48
Showing with 11 additions and 2 deletions
rte
\ No newline at end of file
with open(r'C:\Users\HW\Desktop\test.txt','w',encoding='utf-8') as file:
file.write("小强:10本")
with open(r'C:\Users\HW\Desktop\test.txt','r',encoding='utf-8') as file:
new_file=" "
for data in file:
if "小强:10本" in data:
data=data.replace("小强:10本","小强:10.1本")
print(data)
new_file=data
with open(r'C:\Users\HW\Desktop\test.txt','w',encoding='utf-8') as file:
file.write(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