The Unicode standard describes how characters are represented by code points and contains a lot of tables listing characters and their corresponding code points:
0061 'a'; LATIN SMALL LETTER A 0062 'b'; LATIN SMALL LETTER B
From https://docs.python.org/2/howto/unicode.html#definitions
在Python中,字符有两种不同的显示形式,这两种形式是相等的:
u'中文' == u'\u4e2d\u6587'
显然,人类想要阅读u'中文'
,而不是u'\u4e2d\u6587'
。但在Python2的某些情况下,unicode仅显示为unicode点:
>>> print(u'\u4e2d\u6587')
中文
>>> print({u'\u4e2d\u6587': 1})
{u'\u4e2d\u6587': 1}
>>> print([u'\u4e2d\u6587', 1])
[u'\u4e2d\u6587', 1]
但是Python3没有问题
>>> print({u'\u4e2d\u6587': 1})
{'中文': 1}
>>> print([u'\u4e2d\u6587', 1])
['中文', 1]
以下是我的问题:
我在以下链接中没有找到好的解决方案:
目前没有回答
相关问题 更多 >
编程相关推荐