我在使用unicode表示的列表时遇到问题。我试着研究其他问题json.dumps文件()函数显示一个u'string,但对我来说不是这样。我不能遍历这个列表,因为python将整个列表看作一个字符串,并给我单独的字符。这里有一些代码。你知道吗
print flist
print type(flist)
['a', 'b', 'c']
<type 'unicode'>
myjson = json.dumps(flist)
print myjson
print type(myjson)
"['a', 'b', 'c']"
<type 'str'>
不是吗?地址:
[u'a', u'b', u'c']
试试看评估你知道吗
相关问题 更多 >
编程相关推荐