📜  打开文件 rw python 代码示例

📅  最后修改于: 2022-03-11 14:45:35.295000             🧑  作者: Mango

代码示例1
with open(filename, "r+") as f:
    data = f.read()
    f.seek(0)
    f.write(output)
    f.truncate()