dd = {}
# 添加字典内容
with open("a.json", "w") as f:
f.write(json.dumps(dd, ensure_ascii=False, indent=4, separators=(',', ':')))
[PYTHON]字典生成可阅读的json文件
最新推荐文章于 2024-08-22 20:33:36 发布
dd = {}
# 添加字典内容
with open("a.json", "w") as f:
f.write(json.dumps(dd, ensure_ascii=False, indent=4, separators=(',', ':')))