Displaying Unicode Chars

James Matthews nytrokiss at gmail.com
Sun Feb 10 15:57:32 EST 2008


Why don't you use ord?

2008/2/10 gregpinero at gmail.com <gregpinero at gmail.com>:

> I want to make a little Python utility where a user can enter the
> unicode numerical code and get the actual symbol back in utf-8.
>
> For example, a user could enter something like u221E
>
> And get back ∞
>
> Now, this does seem to work:
>
> >>> print u"\u221E"
>> However how can I change it so it works with a string variable?
>
> print unicode("\u221E") doesn't seem to do it.
>
> I hope this makes sense.  I don't know all the unicode terminology to
> phrase this question coherently ;-)
>
> Thanks in advance,
>
> Greg
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
http://search.goldwatches.com/?Search=Movado+Watches
http://www.jewelerslounge.com
http://www.goldwatches.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080210/699142af/attachment-0001.html>


More information about the Python-list mailing list