目录 文件的基本操作 1. 打开文件 示例: 1.1 文件模式 示例: 1.2 文件的关闭 示例: 文件的读取方法 2.1 read() 方法 示例: 2.2 readline() 方法 示例: 2.3 readlines() 方法 示例: 文件的写入方法 3.1 write() 方法