二进制字符串

str-bytes:str.encode()编码

bytes-str:bytes.decode()解码

或:

a='hehe'

b=bytes(a,encoding='utf-8')

#b=b'hehe'

猜你喜欢

转载自blog.csdn.net/qq_42393859/article/details/80638924