原文:AttributeError: 'str' object has no attribute 'decode'

python 下列代码会报上边的错 print Response: , resp.text.decode unicode escape 解决办法:print Response: , resp.text.encode utf .decode unicode escape 中间加上.encode utf 即可。 问题原因:python 里面,字符串要先encode手动指定其为某一编码的字节码之后,才能 ...

2019-09-24 22:49 0 18837 推荐指数:

查看详情

AttributeError: 'str' object has no attribute 'decode'

python3下列代码会报上边的错 print("Response:", resp.text.decode('unicode_escape'))解决办法:print("Response:", resp.text.encode('utf-8').decode('unicode_escape ...

Mon Aug 10 18:23:00 CST 2020 0 888
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM