Questions tagged «bytestring»

4
如何将Python 3字节字符串变量转换为常规字符串?
我已经阅读了一个XML电子邮件附件 bytes_string=part.get_payload(decode=False) 正如我的变量名所示,有效负载以字节字符串形式出现。 我正在尝试使用推荐的Python 3方法将此字符串转换为可以操纵的可用字符串。 该示例显示: str(b'abc','utf-8') 如何将b(bytes)关键字参数应用于变量bytes_string并使用推荐的方法? 我尝试的方法不起作用: str(bbytes_string, 'utf-8')
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.