标签:
import codecs import os #格式转换 fhanzi1 = codecs.open(os.path.join(outputpath,"hanzi1.txt"),"r") fhanzi = codecs.open(os.path.join(outputpath,"hanzi.txt"),"w") result_f = codecs.EncodedFile(fhanzi1,‘utf-8‘,‘gbk‘) for chars in result_f: fhanzi.write(chars) fhanzi1.close() fhanzi.close() os.remove(os.path.join(outputpath,"hanzi1.txt"))
标签:
原文地址:http://www.cnblogs.com/xiaobaichuangtianxia/p/5654278.html