Commit 0c0473c1 by BellCodeEditor

save project

parent 14898e47
Showing with 6 additions and 1 deletions
...@@ -7,5 +7,9 @@ ...@@ -7,5 +7,9 @@
# sb.close() # sb.close()
with open(r"C:\Users\燕子红\Desktop\123.txt","a",encoding="utf-8") as sb: with open(r"C:\Users\燕子红\Desktop\123.txt","a",encoding="utf-8") as sb:
sb.write("小兰:12本\n") sb.write("小兰:12本\n")
sb.write("小强:12\n") sb.write("小强:11\n")
sb.write("李明:15本\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
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