hexacodes in python?

Jp Calderone exarkun at meson.dyndns.org
Wed Sep 18 02:46:16 CEST 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('?')
63

  If you want this in hexadecimal, 'hex':

>>> hex(63)
'0x3f'


    Jp

-- 
        "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.pgp>


More information about the Python-list mailing list