hex notation funtion

Irmen de Jong irmen at -nospam-remove-this-xs4all.nl
Tue Jan 18 13:54:25 EST 2005


tertius wrote:
> Hi,
> 
> Is there a builtin function that will enable me to display the hex 
> notation of a given binary string? (example below)

Does this help:

 >>> "hello".encode("hex")
'68656c6c6f'
 >>> "deadbeef".decode("hex")
'\xde\xad\xbe\xef'

?

--Irmen



More information about the Python-list mailing list