第八章 今日内容 文件操作 读操作 写操作 +操作 其他操作 读操作 r模式f = open('test.txt', mode='r', encoding='utf-8')print(f.read())f.close()with open('test.txt', 'r', encoding='utf-8')as f: print(f.read()) # 两种方式获得文件句柄,推荐with,运行完之后自动关闭文件 rb模式with open('test.txt', 'rb', encoding=…