漂亮地打印python字典
Xajhqffl
・1 分钟阅读
我昨天才发现这个,如果你有一个以上几项需要读取的字典,json.dumps()
函数将自动为你设置一个indent
参数:
import json
...
print json.dumps(my_dict, indent=1)