Commit d35092b8 by BellCodeEditor

save project

parent 0c0473c1
Showing with 5 additions and 5 deletions
......@@ -5,11 +5,11 @@
# sb=open(r"C:\Users\燕子红\Desktop\123.txt","a",encoding="utf-8")
# sb.write("小丽:12本\n")
# sb.close()
with open(r"C:\Users\燕子红\Desktop\123.txt","a",encoding="utf-8") as sb:
with open(r"C:\Users\燕子红\Desktop\123.txt","w",encoding="utf-8") as sb:
sb.write("小兰:12本\n")
sb.write("小强:11\n")
sb.write("小强:12\n")
sb.write("李明:15本\n")
with open(r"C:\Users\燕子红\Desktop\123.txt","r",encoding="utf-8") as a:
for date in a:
if "小强:11本" in date:
print("在文件中")
\ No newline at end of file
if "小强:12本" in date:
\ 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