📜  json 转储到文件 - Python 代码示例

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

代码示例6
# to write on file
# data_dict is a dictionary

import json
        
with open('data.json', 'w') as f:
    json.dump(data_dict, f)