Commit 43688b1a by BellCodeEditor

save project

parent ad77e972
Showing with 7 additions and 95 deletions
...@@ -21,99 +21,11 @@ ...@@ -21,99 +21,11 @@
file = open (r"C:\Users\kk\Desktop\test.txt",'w',encoding='utf—8' ) file = open (r"C:\Users\kk\Desktop\test.txt",'w',encoding='utf—8' )
file.write('werdgtfsdg') file.write('werdgtfsdg')
file.close() file.close()
data1 = ''
with open(r"C:\Users\kk\Desktop\test.txt",'r',encoding='utf—8')as file:
for data in file:
if 'werdgtfsdg' in data:
data=data.replace('werdgtfsdg','xiaoqiang:123456789')
data1 += data
with open(r"C:\Users\kk\Desktop\test.txt",'r',encoding='utf—8')as file1:
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