Matthew Gregan <[EMAIL PROTECTED]> writes:

[snip]

>>>> print "%d" % ord(z)
> 247
>>>> print "%c" % ord(z)
> �
>>>> print "%x" % ord(z)
> f7

You don't really need to use %-formatting here though:

>>> print ord(z)
247
>>> print chr(ord(z))
�
>>> print hex(ord(z))
0xf7

Which option to use depends on what you intend to do with the results.

-- 
"Hanging is too good for a man who makes puns; he should be drawn and quoted."
        -- Fred Allen

Reply via email to