Commit 7bde98b9 by BellCodeEditor

save project

parent a3e55833
Showing with 12 additions and 4 deletions
# a=open(r"C:\Users\Windows 10\Desktop\book.txt",'w',encoding='utf-8')
# a.write("小兰:12本\n小丽:11本\n李文:9本\n张伟:16本\n")
a=open(r"C:\Users\Windows 10\Desktop\book.txt",'w',encoding='utf-8')
a.write("小兰:12本\n小丽:11本\n李文:9本\n张伟:16本\n")
a.close()
with open(r"C:\Users\Windows 10\Desktop\book.txt","a",encoding="utf-8") as a:
a.write("\n小兰:12本\n")
# a=open(r"C:\Users\Windows 10\Desktop\book.txt",'r',encoding='utf-8')
# b=a.read()
# print(b)
# a.close()
# with open(r"C:\Users\Windows 10\Desktop\book.txt","a",encoding="utf-8") as a:
# a.write("\n小兰:12本\n")
with open(r"C:\Users\Windows 10\Desktop\book.txt",'r',encoding='utf-8') as a:
b=a.read()
print(b)
\ 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