Python - Converting Hex to INT/CHAR

后端 未结 6 2173
你的背包
你的背包 2020-12-10 16:54

I am having some difficulty changing a hex to an int/char (char preferably). Via the website; http://home2.paulschou.net/tools/xlate/ I enter the hex of C0A80026 into the he

6条回答
  •  猫巷女王i
    2020-12-10 17:31

    >>> htext='C0A80026'
    >>> [int(htext[i:i+2],16) for i in range(0,len(htext),2)]
    # [192, 168, 0, 38]
    

提交回复
热议问题