[Python-Dev] Extending hex() and oct() to accept strings

Bob Halley halley at play-bow.org
Thu Aug 28 07:30:09 EDT 2003


Guido van Rossum <guido at python.org> writes:

> And I think that what you really wanted is probably closer to this:
> 
>   >>> import binascii
>   >>> binascii.hexlify('ABC')
>   '414243'
>   >>> 

Or

        >>> 'ABC'.encode('hex_codec')
        '414243'

        >>> '414243'.decode('hex_codec')
        'ABC'

/Bob



More information about the Python-Dev mailing list