Commit 003b6ee1 by BellCodeEditor

save project

parent bdb583fe
Showing with 11 additions and 0 deletions
with open(r"C:\Users\Administrator\Desktop\test.txt","a",encoding="utf-8")as jmy:
jmy.write('小兰:12\n小丽:11\n')
i=''
with open(r"C:\Users\Administrator\Desktop\test.txt","r",encoding="utf-8")as jmy:
for a in jmy:
if '小兰:12' in a:
a=a.replace('小兰:12','小兰:15')
i+=a
with open(r"C:\Users\Administrator\Desktop\test.txt","w",encoding="utf-8")as jmy:
jmy.write(i)
\ 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