!/usr/bin/env python
coding=utf-8
import os
f = open("to_search.txt","r")
w = open('to_search_finish', 'w')
linesz = f.readlines()
for line in linesz:
commandstr = "pypinyin " + line.strip() + " -s TONE3"
ret1 = os.popen( commandstr ).read()
print ret1
w.write( line.strip() + " " + ret1.strip().upper())
w.write("\r\n")
f.close()
w.close()
网友评论