Commit 5b02ab21 by BellCodeEditor

auto save

parent e5351b87
Showing with 12 additions and 0 deletions
new_dat=''
with open(r"C:\Users\Administrator\Desktop\book.txt','r',encoding='utf-8') as file1:
for data in file1:
if 'xiaoming:9' in data:
data=data.replace('liming:9','liming:5')
if'xiaoqiang:4'in data:
data=data.replace('xiaoqing:4','xiaoqiang:7')
new_data+=data
with open(r"C:\Users\Administrator\Desktop\book.txt','w',encoding='utf-8') as file1:
fil1.write
\ 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