Commit aaa33e81 by BellCodeEditor

save project

parent 76d0a6b6
Showing with 4 additions and 2 deletions
...@@ -9,4 +9,7 @@ file.write('张伟:16本\n') ...@@ -9,4 +9,7 @@ file.write('张伟:16本\n')
file.close() file.close()
with open(r"C:\Users\小梦\Desktop\test.txt",'a',encoding='utf-8') as file: with open(r"C:\Users\小梦\Desktop\test.txt",'a',encoding='utf-8') as file:
file.write('小强:10本\n') file.write('小强:10本\n')
file.write('小明:15本\n') file.write('小明:15本\n')
\ No newline at end of file with open(r"C:\Users\小梦\Desktop\test.txt",'r',encoding='utf-8') as file:
a = file.read()
print(a)
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