python/python二进制、字节、字符串转换
函数bin(x)
例子:
a=1
b1=bin(a)
i1 = int(b1,2)
s1="x"
b2 = s1.encode("utf-8")
s3 = b2.decode("utf-8")
byte1 = b"byte example"
str1 = "str example"
bytes(str1,encoding="utf-8")
str(byte1,encoding="utf-8")