-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
77 lines (70 loc) · 2.2 KB
/
test.py
File metadata and controls
77 lines (70 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
'''
字符集 字数 Unicode 编码
基本汉字 20902字 4E00-9FA5
基本汉字补充 90字 9FA6-9FFF
扩展A 6592字 3400-4DBF
扩展B 42720字 20000-2A6DF
扩展C 4154字 2A700-2B739
扩展D 222字 2B740-2B81D
扩展E 5762字 2B820-2CEA1
扩展F 7473字 2CEB0-2EBE0
扩展G 4939字 30000-3134A
扩展H 4192字 31350-323AF
康熙部首 214字 2F00-2FD5
部首扩展 115字① 2E80-2EF3
兼容汉字 472字② F900-FAD9
兼容扩展 542字 2F800-2FA1D
汉字笔画 36字 31C0-31E3
汉字结构 12字 2FF0-2FFB
汉语注音 43字 3105-312F
注音扩展 32字 31A0-31BF
〇 1字 3007
Unicode 版本:15.0
字数备注:
① 部首扩展:2E9A 是空码位。
② 兼容汉字:FA6E、FA6F 是空码位。
此页面的字数按实际字数标示(排除空码位),编码范围则排除了首尾空码位。另一个页面《世界文字大全》的编码范围标注则与 Unicode 一致(包括空码位)。
另,原有 PUA 字符产生于上世纪九十年代,现已全部标准化拥有正式码位,故从表中删除。
'''
a = []
def exappend(start, end=None):
if end is None:
end = start
start = int(f'0x{start}', 16)
end = int(f'0x{end}', 16)
a.extend([chr(i) for i in range(start, end+1)])
def excluade(unic):
a.remove(chr(int(f'0x{unic}', 16)))
exappend('4e00', '9fa5')
exappend('9fa6', '9fff')
exappend('3400', '4dbf')
exappend('20000', '2a6d6') #2a6d7及以后均不能显示
exappend('2a700', '2b734') #2b735及以后均不能显示
exappend('2b740', '2B81d')
exappend('2b820', '2cea1')
exappend('2ceb0', '2ebe0')
# exappend('30000', '3134a')
# exappend('31350', '323af')
exappend('2f00', '2fd5')
exappend('2e80', '2ef3')
exappend('f900', 'fa6d') #空码位后均不能显示
# exappend('2f800', '2fa1d')
exappend('31c0', '31e3')
# exappend('2ff0', '2ffb') #汉字结构
exappend('3105', '312e') #312f不能显示
exappend('31a0', '31b7') #31b8及以后均不能显示
exappend('3007')
excluade('2e9a')
# excluade('fa6e')
# excluade('fa6f')
import random as rd
unicode = []
for ln in range(8):
for col in range(7):
unicode.append(ord(rd.choice(a)))
print(chr(unicode[-1]), end='')
if ln%2==0: print(',')
else: print('。')
# print(unicode)
#FAC4 FA92
input()