python乘法代码 我怎样才能把字节转换成Python中的字符串?

我怎样才能把字节转换成Python中的字符串?#bytes object b=b “example ”#str object s=“example ”#str to bytes bytes(s,enc

我怎样才能把字节转换成Python中的字符串?

#bytes object b=b “example ”#str object s=“example ”#str to bytes bytes(s,encoding=“utf8”)#bytes to str str(b,encoding=“utf-8”)#另一种方法#str to bytesstr.encode编码(s) #字节到字符串字节.解码(二)