python 字符串 decode('hex')encode('hex')

xiaoxiao2021-02-28  9

代码:

# -*- 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

如果放开的话 会出错

转载请注明原文地址: https://www.6miu.com/read-2050119.html

最新回复(0)