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之基本数据类型与数据结构
- 下一篇 »寻找两个数组中的公共元素Java程序代码