I am testing function isprintable()
. I want to print the Unicode NAMES of all characters in string string.whitespace + unicodedata.lookup("GREEK SMALL LETTER ALPHA")
.
How to print the all the names - e.g 'SPACE', 'NO-BREAK SPACE', HORIZONTAL TAB, 'GREEK SMALL LETTER ALPHA.
import unicodedata, string
for e in string.whitespace + unicodedata.lookup("GREEK SMALL LETTER ALPHA"):
print(ord(e))
print(unicodedata.name(e))
I get error 'ValueError: no such name'
32
SPACE
9
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
ValueError: no such name