Commit 7863f023 by BellCodeEditor

save project

parent 665f996e
Showing with 8 additions and 4 deletions
c=""
b=""
with open(r'C:\Users\Think\Desktop\text.txt','r',encoding='utf-8') as a:
for i in a:
if "小李:2" in i:
print("文件在文件夹里面")
\ No newline at end of file
i=i.replace("小李:2","小李:3")
c=c+i
print(c)
with open(r'C:\Users\Think\Desktop\text.txt','w',encoding='utf-8') as a:
a.write(c)
\ 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