Python将繁体转换为简体

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)

你可能感兴趣的:(python)