Python python打印json文件加上pretty 发表于 2016-10-09 浏览量 1195 没有评论 在生成文件的时候,加上两个参数即可json.dumps(dict, indent=4, sort_keys=True)