字节串转字符串:
b = b'some byte array'
str(b, encoding = "utf-8")
#or
bytes.decode(b)
然后是字符串转为字节串:
s = 'some string'
bytes(s, encoding = "utf8")
#or
str.encode(s)
字节串转字符串:
b = b'some byte array'
str(b, encoding = "utf-8")
#or
bytes.decode(b)
然后是字符串转为字节串:
s = 'some string'
bytes(s, encoding = "utf8")
#or
str.encode(s)