在Python中,我可以按名称打印一个unicode字符(例如print(u'\N{snowman}')).有没有办法获得所有有效名称的列表?
每个代码点都有一个名称,因此您实际上要求的是整个Unicode标准.
每个Python版本都支持Unicode标准的特定版本; 该unicodedata.unidata_version属性告诉您哪个给定的Python运行时.
每个代码点,该unicodedata.name()函数可以告诉您正式名称,并unicodedata.lookup()为您提供反向(代码点的名称).
如果您想要所有 Unicode 字符名称的列表,请考虑下载Unicode 字符数据库。
它包含在许多 Linux 发行版的基础存储库中(例如 RHEL 上的“unicode-ucd”)。
该包包括NamesList.txt,其中包含 unicode 字符名称的详尽列表。
注意:NamesList.txt需要一些时间下载(大小> 1.5 MB)。
例子:
21FE RIGHTWARDS OPEN-HEADED ARROW
21FF LEFT RIGHT OPEN-HEADED ARROW
@@ 2200 Mathematical Operators 22FF
@@+
@ Miscellaneous mathematical symbols
2200 FOR ALL
= universal quantifier
2201 COMPLEMENT
x (latin letter stretched c - 0297)
2202 PARTIAL DIFFERENTIAL
2203 THERE EXISTS
= existential quantifier
2204 THERE DOES NOT EXIST
: 2203 0338
2205 EMPTY SET
= null set
* used in linguistics to indicate a null morpheme or phonological "zero"
x (latin capital letter o with stroke - 00D8)
x (diameter sign - 2300)
~ 2205 FE00 zero with long diagonal stroke overlay form
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2687 次 |
| 最近记录: |