Quick tutorial on using the unicodedata module?

Christos TZOTZIOY Georgiou DLNXPEGFQVEB at spammotel.com
Wed Jan 1 14:51:35 EST 2003


On 01 Jan 2003 08:00:37 +0100, rumours say that martin at v.loewis.de
(Martin v. Löwis) might have written:

>downloading the Unicode database, and searching for a characters with
>grep(1) is much more appropriate.

Would this help at all?

import unicodedata, sys

unicode_names= []
for ix in range(sys.maxunicode+1):
    try:
        unicode_names.append( (ix, unicodedata.name(unichr(ix))) )
    except ValueError: # no name for the character
        pass

This is to be used for a grep-like function... therefore a list of
tuples (indexing the list is not meaningful).

Happy new year to everyone following AD time notation :)
-- 
TZOTZIOY, I speak England very best,
Real email address: 'dHpvdEBzaWwtdGVjLmdy\n'.decode('base64')




More information about the Python-list mailing list