Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如:
>>> print json.dumps('růže') "r\u016f\u017ee"
(当然,在实际程序中它不仅仅是一个字符串,而且在使用时它在文件中也是这样出现的json.dump())我也希望它输出简单的“růže”,如何做到这一点?
json.dump()
将参数传递ensure_ascii=False给 json.dumps:
ensure_ascii=False
>>> print json.dumps('růže', ensure_ascii=False) "růže"