pip install zhconv
测试:
import zhconv
# 简繁体转换
s = '朝斗坛前山月幽,师雄有梦生清愁。何时杖尔看南雪,我与梅花两白头。'
s1 = zhconv.convert(s, 'zh-hant')
s2 = zhconv.convert(s, 'zh-tw')
s3 = zhconv.convert(s, 'zh-hk')
print('转化为繁体结果:', s1)
print('转化为台湾正体结果:', s2)
print('转化为香港繁体结果:', s3)