'#安装两个库:pip install pywubi,xpinyin
from pywubi import wubi
from xpinyin import Pinyin
zh_ch_arr=[] #输出所有汉字
pn = Pinyin() #拼音
for ch in range(0x4e00, 0x9fa6): #汉字编码的有效范围是0x4e00-0x9fa5
s = "u{:04x}".format(ch)``
zh_ch = s.encode("utf-8").decode("unicode_escape")
zh_pn = pn.get_pinyin(zh_ch)
zh_pn1 = pn.get_pinyin(zh_ch,tone_marks="marks")
zh_wb = wubi(zh_ch) #五笔字码
zh_ch_arr.append((zh_pn,(zh_pn1,zh_ch,zh_wb[0])))
'#按照拼音顺序排序
zh_ch_arr.sort()
for str in zh_ch_arr:
(p,s)=str
print(s)