首先 通过pip现在xpinyin 命令为 pip install xpinyin
from xpinyin import Pinyin
P = Pinyin()
p.get_pinyin(u"上帝", '')
输出结果:shangdi
首先 通过pip现在xpinyin 命令为 pip install xpinyin
from xpinyin import Pinyin
P = Pinyin()
p.get_pinyin(u"上帝", '')
输出结果:shangdi