格式化输出:

1
2
3
import json

json.dumps(x, ensure_ascii=False, indent=2)