首页 > 代码库 > python: int to unicode string

python: int to unicode string

>>> import types
>>> print type(str(2))
<type str>
>>> print type(str(2))
<type str>

# 这里先转为str,在转为unicode >>> print type(str(2).decode(utf-8)) <type unicode> >>> print type(str(32).decode(utf-8)) <type unicode> >>> print str(2).decode(utf-8) 2

 

python: int to unicode string