如何使用python2将字典中的中文输出

笔记:
python的字典转换为中文输出:

#coding:utf-8
import json

dic = {'张三':2,'李四':3,'王五':5}
print json.dumps(dic,encoding='utf-8',ensure_ascii=False)

参考:

https://blog.csdn.net/hwt3525055/article/details/72867218

猜你喜欢

转载自blog.csdn.net/funnyPython/article/details/83782417
今日推荐