Commit ef1595ad by BellCodeEditor

save project

parent 98c72a5d
Showing with 11 additions and 4 deletions
with open(r'F:\Users\CM\Destop\test.txt','r',encoding= 'utf-8') as file_1 with open(r'F:\Users\CM\Destop\test.txt','r',encoding= 'utf-8') as file_1:
for data in file_1: for data in file_1:
if 'chenshi:300斤'in data: if 'chenshi:300斤'in data:
print("数据在里面") data = data.replace('yuyi:300jin','klalak:400jin')
print(data) new _data +=data
\ No newline at end of file
with open(r'F:\Users\CM\Destop\test.txt','r',encoding= 'utf-8') as file_1:
file_1.write(new_data)
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