number base conversion? (ASCII to Hex)

William Park parkw at better.net
Thu May 11 18:06:36 EDT 2000


On Thu, May 11, 2000 at 09:54:26PM +0000, chibaA at TinterlogD.Tcom wrote:
> How would I go about getting the base-16(hex) value of a character,
> into a string?
> 
> take character word[1] (for example)
> and retrieve the hex value of 31
> and assign it to value hexValue in an ascii format (ie. as the number
> 31).

hex(ord('1'))

--William




More information about the Python-list mailing list