Created
May 8, 2015 05:39
-
-
Save Quotation/02c72ea7c43e357aa7fb to your computer and use it in GitHub Desktop.
Python调opencc简繁转换
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from subprocess import Popen, PIPE | |
def chs2cht(chs): | |
return Popen(['opencc'], stdout=PIPE, stdin=PIPE).communicate(chs)[0][:-1] | |
print chs2cht('简体') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment