文件操作 打开/关闭文件: with open('file.txt', 'r') as f: # 自动关闭文件 content = f.read() 读写文件: f.write('Hello, World!') content = f.read() 文件信息: os.path.gets