Commit e65a2e12 by BellCodeEditor

save project

parent 40cf8019
Showing with 9 additions and 7 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.write("小兰:12本\n小丽:11本\n李文:9本\n张伟:16本\n小强:10本")
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","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",'r',encoding='utf-8') as a:
b=a.read()
print(b)
\ No newline at end of file
# with open(r"C:\Users\Windows 10\Desktop\book.txt",'r',encoding='utf-8') as a:
# b=a.read()
# print(b)
new_a=""
with
\ 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