>>> 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

 

相关文章:

  • 2021-07-14
  • 2021-09-05
  • 2021-05-26
  • 2021-05-30
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-23
  • 2021-09-06
  • 2021-12-15
  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案