writing Json file from python script
This question already has an answer here:
您可以将JSON写入文件,如下所示:
import json
d = {"foo": "bar"}
with open("output.json", "w") as f:
json.dump(d, f)
json.dumps()
is the function. It converts a dictionary to str object. Docs
下一篇: 从python脚本编写Json文件