python2与python3区别
区别:
1 #python2: 2 #print() print 'abc' 3 #range() xrange() 生成器 4 # raw_input()输入 5 6 #python3: 7 #print('abc') 8 #range()有序列表 9 # input()
python2:
python3:
一、python3的bytes/str转换
文本总是Unicode,由str类型表示,二进制数据则由bytes类型表示。

cmd:
>>>‘20’.encode('utf-8')
b'\x82\xac20'
>>>b'\x82\xac20'.decode('utf-8')
‘20’
原作者博客链接:https://www.cnblogs.com/cgqForward
浙公网安备 33010602011771号