python2的字典输入中文

2018-01-17  本文已影响0人  不见长安丶灬

笔记:

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

#coding:utf-8

import json

dic = {'张三':2,'李四':3,'王五':5}

print json.dumps(dic,encoding='utf-8',ensure_ascii=False)

上一篇 下一篇

猜你喜欢

热点阅读