How to convert a string to hex?

richard_chamberlain richard_chamberlain at ntlworld.com
Fri Jun 23 02:22:55 EDT 2000


Hi Sam,

import string
b = "6b584"
i=string.atoi(b,16)
print hex(i)

0x6b584

Richard


Sam Wun <swun at esec.com.au> wrote in message
news:3952EC0D.D5CF9066 at esec.com.au...
> Suppose here is:
>
> b = "6b584"
>
> I would like to b to hex. Does anyone know how to do that in python?
>
>
> Thanks
> Sam.
>
>





More information about the Python-list mailing list