Commit af8abdab by BellCodeEditor

save project

parent 0fe0d661
Showing with 9 additions and 4 deletions
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
# filel=open(r"c:\Users\Administrator\Desktop\text.txt",'w',encoding='utf-8') # filel=open(r"c:\Users\Administrator\Desktop\text.txt",'w',encoding='utf-8')
# filel.write('小兰:12本、小丽:11本、李文:9本、张伟:16本') # filel.write('小兰:12本、小丽:11本、李文:9本、张伟:16本')
# filel.close() # filel.close()
filel=open(r"c:\Users\Administrator\Desktop\text.txt",'a',encoding='utf-8') #filel=open(r"c:\Users\Administrator\Desktop\text.txt",'a',encoding='utf-8')
filel.write("\n小强:12本") #filel.write("\n小强:12本")
filel.write("\n李明:15本") #filel.write("\n李明:15本")
\ No newline at end of file # filel.close()
with open(r"c:\Users\Administrator\Desktop\text.txt",'r',encoding='utf-8')as file:
a=file.read()
if "小强:12本" in a:
print("zai")
\ 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