代码:
# -*- coding:utf-8 -*-
str = '\x35'.encode('hex')
print str
str = '5'.encode('hex')
print str
str = '56'.encode('hex')
print str
str = '37'.decode('hex')
print str
str = '3738'.decode('hex')
print str
#str = '37389'.decode('hex')
#print str
结果:
35
35
3536
7
78
Process finished with exit code 0
最后两行
#str = '37389'.decode('hex')
#print str
如果放开的话 会出错