Commit 3683a380 by BellCodeEditor

auto save

parent c6c50fd7
Showing with 8 additions and 3 deletions
...@@ -12,8 +12,13 @@ file.close() ...@@ -12,8 +12,13 @@ file.close()
new_data = []
with open(r'C:\Users\Administrator\Desktop\test.txt','r',encoding='utf-8')as file: with open(r'C:\Users\Administrator\Desktop\test.txt','r',encoding='utf-8')as file:
for data in file: for data in file:
if'a=a'in data: if'a=a'in data:
print('数据') data=data.replace('a=a','a=b')
\ No newline at end of file print(data)
with open(r'C:\Users\Administrator\Desktop\test.txt','w',encoding='utf-8')as file:
file.write(new_data)
\ 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