import jieba
from xpinyin import Pinyin
sentence = "我想说更好的英语,但很难,因为我是中国人"
segments = jieba.cut(sentence,False) # 精确模式
output = " ".join(segments)
print(output)
p = Pinyin()
#marks 带上音标 lower小写字母
pinyined = p.get_pinyin(output, splitter='', tone_marks='marks',convert='lower')
print(pinyined)