unicode study with unicodedata module

Christos TZOTZIOY Georgiou tzot at sil-tec.gr
Tue Mar 15 08:35:29 EST 2005


On 15 Mar 2005 04:55:17 -0800, rumours say that "Xah Lee" <xah at xahlee.org> might
have written:

>how do i get a unicode's number?
>
>e.g. 03ba for greek lowercase kappa? (or in decimal form)

you get the character with:

.>> uc = u"\N{GREEK SMALL LETTER KAPPA}"

or with

.>> uc = unicodedata.lookup("GREEK SMALL LETTER KAPPA")

and you get the ordinal with:

.>> ord(uc)

ord works for strings and unicode.
-- 
TZOTZIOY, I speak England very best.
"Be strict when sending and tolerant when receiving." (from RFC1958)
I really should keep that in mind when talking with people, actually...



More information about the Python-list mailing list