Commit cc90ebad by BellCodeEditor

save project

parent c4b79040
Showing with 11 additions and 5 deletions
...@@ -4,9 +4,15 @@ ...@@ -4,9 +4,15 @@
# fll.write('小丽:11本\n') # fll.write('小丽:11本\n')
# fll.write('李文:9本\n') # fll.write('李文:9本\n')
# fll.close() # fll.close()
new_data=''
with open(r"C:\Users\EDZ\Desktop\aips.txt","r",encoding="utf-8")as fll: with open(r"C:\Users\EDZ\Desktop\aips.txt","r",encoding="utf-8")as fll:
data=fll.read() data=fll.read()
if '莫测:9001本'in : if '小兰'in data:
print('该数据在里面') data=data.replace('小兰','欧式')
else: new_data+=data
print("该数据不在里面") with open(r"C:\Users\EDZ\Desktop\aips.txt","w",encoding="utf-8")as fll:
\ No newline at end of file fll.write(new_data)
# if '莫测:9001本'in :
# print('该数据在里面')
# else:
# print("该数据不在里面")
\ 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