os.system("command line")
2.重定向之后shell后的输出
def getkeyword(puretext):
try:
app = ['java','-cp','IKAnalyzer2012_u6.jar:.','htParticiple','-f','acm.nyist.net'] #call the java programe
proc = subprocess.Popen(app,stdout=subprocess.PIPE) #redirect the python out
return proc.stdout.read()
except:
return "ERROR"