📌  相关文章
📜  如何将项目添加到现有的 json 文件 python - Javascript 代码示例

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

代码示例1
a_dictionary = {"d": 4}

with open("sample_file.json", "r+") as file:
    data = json.load(file)
    update(a_dictionary)
    seek(0)
    dump(data, file)