python实现中文繁体和中文简体之间的相互转换,,# -*- coding


# -*- coding:utf-8 -*-from langconv import *# 转换繁体到简体line = Converter('zh-hans').convert(line.decode('utf-8'))line = line.encode('utf-8')# 转换简体到繁体line = Converter('zh-hant').convert(line.decode('utf-8'))line = line.encode('utf-8')备注:只需从网上下载langconv.py和zh_wiki.py,放在python代码所在目录即可。

<h4>附件:<a href="/uploadfiles/2013/06/19/137162294852219.zip">源代码下载</a></h4>

评论关闭