Search code examples
pythonhexascii

Convert from ASCII string encoded in Hex to plain ASCII?


How can I convert from hex to plain ASCII in Python?

Note that, for example, I want to convert "0x7061756c" to "paul".


Solution

  • A slightly simpler solution (python 2 only):

    >>> "7061756c".decode("hex")
    'paul'