Commit 2cb7ab25 by BellCodeEditor

auto save

parent 897918d5
Showing with 11 additions and 13 deletions
file=open(r'C:\Users\cc\Desktop\test.txt','w',encoding='uft-8')
file.write('中秋节快乐')
file.close()
new_data=""
file=open(r'C:\Users\cc\Desktop\test.txt','w',encoding='uft-8')
for i in file:
if '国庆'in i:
new=i.replace('国庆','中秋')
new_data=new_data+new
print(new_data)
file=open(r'C:\Users\cc\Desktop\test.txt,'w',encoding='uft-8)
file.write('国庆节快乐')
file.close()
file=open(r'C:\Users\cc\Desktop\test.txt,'w',encoding='uft-8)
a=file.read()
print(q)
file.cloce()
file=open(r'C:\Users\cc\Desktop\test.txt,'w',encoding='uft-8)
for i in file:
if '国'in i:
print('所找内容在文件里')
\ 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