$ pip install pinyin4py from anjuke import pinyin converter = pinyin.Converter() converter.load_word_file('words.txt') print converter.convert('ä¸æ–‡æµ‹è¯•')