# bytes object
b = b'n02509815'
# str object
s = "example"
# str to bytes编码
str.encode(s)#此时和b相等
# bytes to str解码
bytes.decode(b)#此时和s相等
python2字符编码
最新推荐文章于 2023-01-30 09:48:52 发布
# bytes object
b = b'n02509815'
# str object
s = "example"
# str to bytes编码
str.encode(s)#此时和b相等
# bytes to str解码
bytes.decode(b)#此时和s相等