python3 美化输出json

import json
a={'4': 5, '6': 7}
print(json.dumps(a, sort_keys=True, indent=4))



输出
{
    "4": 5,
    "6": 7
}

原文地址:https://www.cnblogs.com/sea-stream/p/12162694.html