Commit 0cf9b945 by BellCodeEditor

auto save

parent 3158bb84
Showing with 14 additions and 0 deletions
teacher=open(r"C:\Users\ZHENTAN\Desktop\test.txt","w",encoding='utf-8')
teacher.write('曹岩岩')
newdate=""
with open(r"C:\Users\ZHENTAN\Desktop\test.txt","r",encoding='utf-8')as teacher:
for date in teacher:
if '曹岩岩' in date:
date=date.replace('曹岩岩','老师')
print(date)
newdate += date
print(newdate)
with open(r"C:\Users\ZHENTAN\Desktop\test.txt","w",encoding='utf-8')as teacher:
teacher.write(newdate)
#teacher.replace('曹岩岩','老师')
\ 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