Commit 825172ef by BellCodeEditor

save project

parent 5248f8f0
Showing with 13 additions and 0 deletions
new_date=''
with open(r'C:\Users\Administrator\Desktop\book.txt',"r",encoding='utf-8') as file:
for date in file:
if '123321'in date:
date = date.replace('123321','456654')
new_date += date
with open(r'C:\Users\Administrator\Desktop\book.txt',"w",encoding='utf-8') as file:
file.write(new_date)
with open(r'C:\Users\Administrator\Desktop\book.txt',"r",encoding='utf-8') as file:
a=file.read()
print(a)
\ 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