当前位置: 代码迷 >> 综合 >> python3.6报错:AttributeError: 'str' object has no attribute 'decode'解决方法
  详细解决方案

python3.6报错:AttributeError: 'str' object has no attribute 'decode'解决方法

热度:95   发布时间:2023-12-29 01:15:58.0

将

print ('张三'.decode('utf-8')) //错误

改为

print ('张三'.encode('utf-8').decode('utf-8')) //正确

  相关解决方案