Commit 943a35dd by BellCodeEditor

save project

parent 1f0adf77
Showing with 10 additions and 0 deletions
......@@ -7,3 +7,13 @@ with open(r"C:\Users\lenovo\Desktop\book.txt",'r') as filtel:
for data in filtel:
if '222' in data:
print('数据在文件')
new_data=""
with open(r"C:\Users\lenovo\Desktop\book.txt",'r')as filtel:
for data in filtel:
if '111' in data:
data=data.replace("111","444")
new_data +=data
with open(r"C:\Users\lenovo\Desktop\book.txt",'w')as filtel:
filtel.write(new_data)
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