Commit 6d275ad5 by BellCodeEditor

save project

parent edf034a1
Showing with 9 additions and 5 deletions
...@@ -2,9 +2,12 @@ ...@@ -2,9 +2,12 @@
# a=open(r"D:\桌面\新建文本文档.txt",'w',encoding='utf-8') # a=open(r"D:\桌面\新建文本文档.txt",'w',encoding='utf-8')
# a.write('小兰:12本,小丽:11本,李文:9本,张伟:16本') # a.write('小兰:12本,小丽:11本,李文:9本,张伟:16本')
# a.close() # a.close()
with open(r"C:\Users\Administrator\Desktop\新建文本文档.txt",'a',encoding='utf-8') as file1: # with open(r"C:\Users\Administrator\Desktop\新建文本文档.txt",'a',encoding='utf-8') as file1:
file1.write("小兰:12本\n") # file1.write("小兰:12本\n")
file1.write("小丽:11本\n") # file1.write("小丽:11本\n")
# with open(r"C:\Users\Administrator\Desktop\新建文本文档.txt",'r',encoding='utf-8') as file1:
# n=file1.read()
# print(n)
with open(r"C:\Users\Administrator\Desktop\新建文本文档.txt",'r',encoding='utf-8') as file1: with open(r"C:\Users\Administrator\Desktop\新建文本文档.txt",'r',encoding='utf-8') as file1:
n=file1.read() for i in file1:
print(n) print(i)
\ 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