AI编程生活评测
标签

# 文件IO

编程笔记 / 2 min

Python笔记:文件IO操作

读取文件 使用 open() 打开文件,文件不存在会抛出 IOError 错误。 try: f = open('/path/to/file', 'r') print(f.read()) finally: if f: f.close() 文件...