发布网友
共3个回答
热心网友
bytes解码会得到str
str编码会变成bytes
>>> b'123'.decode('ascii')
热心网友
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a = b'123'
>>> a.decode()
'123'
热心网友
b'123'.decode()
结果是'123'