http://blog.csdn.net/wds2006sdo/article/details/53583367
from langconv import * def Traditional2Simplified(sentence): ‘‘‘ 将sentence中的繁体字转为简体字 :param sentence: 待转换的句子 :return: 将句子中繁体字转换为简体字之后的句子 ‘‘‘ sentence = Converter(‘zh-hans‘).convert(sentence) return sentence if __name__=="__main__": traditional_sentence = ‘憂郁的臺灣烏龜‘ simplified_sentence = Traditional2Simplified(traditional_sentence) print(simplified_sentence) ‘‘‘ 输出结果: 忧郁的台湾乌龟 ‘‘‘
原文:http://www.cnblogs.com/xqnq2007/p/7745545.html