Commit 224d7de1 by BellCodeEditor

save project

parent 0ead547f
Showing with 5 additions and 3 deletions
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
file = open("C:\\Users\\wzj\\Desktop\\test.txt",'w',encoding ='utf-8') file = open("C:\\Users\\wzj\\Desktop\\test.txt",'w',encoding ='utf-8')
file.write("小兰:12本\n小丽:11本\n李文:9本\n张伟:16本") file.write("小兰:12本\n小丽:11本\n李文:9本\n张伟:16本")
file.close() file.close()
with open(r"C:\Users\wzj\Desktop\test.txt",'a',encoding ='utf-8') as file:
file.write("\n小强:12本\n李明:11本\n") with open("C:\\Users\\wzj\\Desktop\\test.txt",'r',encoding ='utf-8') as file:
\ No newline at end of file a = file.read()
print(a)
\ 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