Binary to Hex conversions

piet at cs.uu.nl piet at cs.uu.nl
Fri Aug 18 11:48:09 EDT 2000


>>>>> Pieter Claerhout <PClaerhout at CREO.BE> (PC) writes:

PC> And how can a hex number (which i have as string)
PC> be converted to an integer??

import string
i = string.atoi(hexstring,16)
or
l = string.atol(hexstring,16) to get a long int
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list