result=pinyin('中國', style=Style.TONE2) print(result)# [['zho2ng'], ['guo2']] # 首字母風格 result=pinyin('中國', style=Style.FIRST_LETTER) print(result)# [['z'], ['g']] 將中文姓名轉(zhuǎn)換為拼音: 1 2 3 # 懶加載方式,適用于長文本或需要節(jié)省內(nèi)存的
www.dbjr.com.cn/python/334424a...htm 2025-5-16