pypinyin

作者: 04282aba96e3 | 来源:发表于2018-02-08 11:58 被阅读33次

    !/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()

    相关文章

      网友评论

          本文标题:pypinyin

          本文链接:https://www.haomeiwen.com/subject/oafttftx.html