解决Python字符串显示u'...'的问题

版本:python2.7   2.7   2.7!!! 症状:好比,我编写了一个字符串number,输出到网页上,变成了u'number'python 解决方法:json num = "number".encode('utf-8') print(num) 即把它以‘utf-8’编码形式编码, 注意encode('utf-8')方法对list和dict类型应该是不支持,若是你想把这些字符串存到lis
相关文章
相关标签/搜索