二进制类型/字节(bytes) bytes(数据) 二进制类型转换
print(bytes(10))
print(bytes('abc',encoding
='utf-8'))
print(bytes([1,2,3]))
str1
='hello'
b1
=str1
.encode
(encoding
='utf-8')
print(b1
)
b1
=b
"[100,99,'98']"
str1
=str(b1
,encoding
='utf-8')
print(str1
)
print(eval(str1
))
b2
=b
'hello'
str2
=b2
.decode
(encoding
='utf-8')
print(str2
)
转载请注明原文地址: https://lol.8miu.com/read-12885.html