# 字节 对象
b = b"lishaoshu"
# str 对象
s = "lishaoshu"
# str to bytes
sb = bytes(s, encoding = "utf8")
# bytes to str
bs = str(b, encoding = "utf8")
# 方法二
# str to bytes
sb2 = str.encode(s)
# bytes to str
bs2 = bytes.decode(b)
# 字节 对象
b = b"lishaoshu"
# str 对象
s = "lishaoshu"
# str to bytes
sb = bytes(s, encoding = "utf8")
# bytes to str
bs = str(b, encoding = "utf8")
# 方法二
# str to bytes
sb2 = str.encode(s)
# bytes to str
bs2 = bytes.decode(b)