Commit bd30e160 by BellCodeEditor

save project

parent 9a5c28be
Showing with 9 additions and 0 deletions
new_data = ''
with open(r'C:\Users\EDZ\Desktop\test.txt','r',encoding='utf-8') as file:
for data in file:
if "李强" in data:
print("数据在文件中")
data=data.replace('李强'','李强2')
new_data=data+new_data
print(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