📜  替换 json 数据 python - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:52.383000             🧑  作者: Mango

代码示例1
with open('file.json', 'r+') as file:
    content = file.read()
    file.seek(0)
    content.replace('string_replaced', 'new_string')
    file.write(content)