Commit 19699824 by BellCodeEditor

save project

parent 239f9f7c
Showing with 20 additions and 5 deletions
with open(r"C:\Users\玛酷机器人\Desktop\sales_list\sales_list.txt")as file: file1=open(r"C:\朱信诺哈哈哈\test.txt","w",encoding="utf-8")
a=file.readlines() file1.write("小丽:10本\n")
file1.write("小强:12本\n")
file1.close()
with open(r"C:\朱信诺哈哈哈\test.txt","r",encoding="utf-8")as file1:
for data in file1:
if "小丽:10本" in data:
print("在数据中")
for i in a:
print(i)
\ 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