1、安装zhconv
pip install zhconv
2、代码如下:
def test01():
"""
将中文繁体转换为中文简体
"""
import zhconv
text = open('源文件','r',encoding='utf-8').read()
text = zhconv.convert(text,'zh-cn')
file = open('目标文件','w',encoding='utf-8')
file.write(text)
print(text)
file.close()