python中包含UTF-8编码中文的列表或字典的输出
num=[123]
b=repr(num)
c=[]
for x in xrange(1,len(b)-1):
c.append(b[x])
s = u'字符串'
L= [c for c in s]
import json
char=[u'梁雪枫']
temp=json.dumps(char, encoding="UTF-8", ensure_ascii=False)
result=[t for t in temp][2:-2]
b=repr(num)
c=[]
for x in xrange(1,len(b)-1):
c.append(b[x])
s = u'字符串'
L= [c for c in s]
import json
char=[u'梁雪枫']
temp=json.dumps(char, encoding="UTF-8", ensure_ascii=False)
result=[t for t in temp][2:-2]
评论
发表评论