先至 github 下載 langconv.py 和 zh_wiki.py 兩支程式

https://github.com/skydark/nstools

Screenshot_1.png

然後便可以根據自己的需求進行轉換

# -*- 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')

arrow
arrow
    文章標籤
    Python 簡體字 繁體字
    全站熱搜

    MingHsiangSu 發表在 痞客邦 留言(0) 人氣()