Commit 4054472b by BellCodeEditor

auto save

parent cb43a88b
Showing with 30 additions and 0 deletions
new_data=''
with open(r'C:\test.txt','w',encoding='UTF-8') as feil:
feil.write('edfghjkl;')
feil.close()
with open(r'C:\test.txt','r',encoding='UTF-8') as feil:
xa=feil.read()
print(xa)
with open(r'C:\test.txt','r',encoding='UTF-8') as feil:
for data in feil:
if 'edfghjkl;' in data:
data.replace('edfghjkl;','adfghjkl;')
new_data+=data
with open(r'C:\test.txt','w',encoding='UTF-8') as feil:
feil.write(new_data)
with open(r'C:\test.txt','a',encoding='UTF-8') as feil:
feil.write('dfhjkl\n')
with open(r'C:\test.txt','r',encoding='UTF-8') as feil:
noxa=feil.readlines()
print(noxa)
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