hexacodes in python?

Jp Calderone exarkun at meson.dyndns.org
Tue Sep 17 20:46:16 EDT 2002

On Tue, Sep 17, 2002 at 04:57:16PM -0300, jubafre at brturbo.com wrote:
> what is the hexacode for '?' in python?
> where can i take the hexacodes?	
> Juliano Freitas
> www.gebrasil.hpg.com.br 

  Assuming you're refering to the ASCII value of a character, the function
you want is 'ord'.

>>> ord('?')

  If you want this in hexadecimal, 'hex':

>>> hex(63)


        "I quite agree with you," said the Duchess; "and the moral of
that is -- Be what you would seem to be' -- or, if you'd like it put
more simply -- Never imagine yourself not to be otherwise than what it
might appear to others that what you were or might have been was not 
otherwise than what you had been would have appeared to them to be
otherwise.'"       -- Lewis Carrol, "Alice in Wonderland"
 8:00pm up 119 days, 20:53, 7 users, load average: 0.00, 0.03, 0.06
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 248 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20020917/ea328c07/attachment.sig>

More information about the Python-list mailing list