import json d={"a":"我们","b":"test"} print(json.dumps(d)) #{"a": "\u6211\u4eec", "b": "test"} print(json.dumps(d,ensure_ascii=False,indent=2)) """ { "a": "我们", "b": "test" } """
标签:输出,格式化,dumps,print,json,test From: https://www.cnblogs.com/boye169/p/16778264.html