#str与bytes之间的类型转换:
#str-->bytes
bytes(str,encoding='utf-8')
str.encode('utf-8')
#bytes-->str
str(bytes,encoding='utf-8')
bytes.decode('utf-8')
#str与bytes之间的类型转换:
#str-->bytes
bytes(str,encoding='utf-8')
str.encode('utf-8')
#bytes-->str
str(bytes,encoding='utf-8')
bytes.decode('utf-8')
转载于:https://my.oschina.net/u/3786144/blog/1789872