from xpinyin import Pinyin
def test_pinyin(self):
list_origin = open("name.txt", "r", encoding="utf-8").readlines()
list_new = open("username.txt", "w")
for item in list_origin:
a = Pinyin()
b = a.get_pinyin(item)
b = b.replace('-', '')
b = 'test_' + b
list_new.write(b)
list_new.close()