Commit e89a2fb4 by BellCodeEditor

auto save

parent 5ec53ebb
Showing with 15 additions and 0 deletions
# # 新建、打开文件
# file = open(r'C:\Users\EDY\Desktop\test.txt','w',encoding='utf-8')
# # 写入数据
# file.write('小兰:12本')
# # 关闭文件
# file.close()
# with open(r'C:\Users\EDY\Desktop\test.txt','a',encoding='utf-8') as file:
# file.write('\n小强:10本\n')
# file.write('李明:15本\n')
# 读取文件
with open(r'C:\Users\EDY\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