Help for unicode

Irmen de Jong irmen at
Sat Nov 8 23:35:33 CET 2003

Noixe wrote:
> Why this istruction:
> print u"\u00" + str(41)
> generate an error and this:
> print u"\u0041"   no?

because they are doing very different things.
The first is first evaluating u"\u00" and only
if that succeeds (but it doesn't) add the string
"41" at the end.

The second is evaluating the unicode escape
sequence \u0041 that is part of the string.

You cannot combine strings like that to form
arbitrary unicode escape sequences. Try this instead;


print unichr(some_variable)

> Can I use all 65536 symbols of unicode in my program? For example, I need to
> use the mathematic symbol of void set. It has a 0198 number in a table of
> symbol that there is in Windows.

No problem to use all unicode symbols.

But I don't think the empty set symbols is Unicode code point U+0198:

 >>> import unicodedata
 >>> unicodedata.lookup("EMPTY SET")

So I think you should use U+2205 instead?

More information about the Python-list mailing list