python 字典和json树形输出

import json

a = {}
print(json.dumps(a, indent=1))
#indent=1代表字节点比父节点前多几个空格

原文地址:https://www.cnblogs.com/jingzaixin/p/13233741.html