Commit ae5e73ab by BellCodeEditor

save project

parent df8b4aac
Showing with 7 additions and 4 deletions
with open(r"C:\Users\2hao\Desktop\新建文件夹\chen.txt","w",encoding="utf-8")as file1:
with open(r"C:\Users\2hao\Desktop\新建文件夹\chen.txt","r"encoding="utf-8")as file1:
for data in file1:
if 'h:19' in data:
print('数据在文件中')
data.replace('h:19','h:20')
\ No newline at end of file
data=data.replace('h:19','h:20')
new_data +=data
with open(r'C:\Users\2hao\Desktop\chen.txt','r'encoding="utf-8") as file1:
file1.write(new_data)
\ 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