python 重定向shell执行输出
来源:互联网 发布:99云呼软件 编辑:程序博客网 时间:2024/05/29 18:50
本文有两个主题:
1.python执行shell
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"
这个代码是执行java分词程序的,传递纯文本文件的路径,然后将结果返回。
- python 重定向shell执行输出
- [python]重定向输出
- python 输出重定向
- shell中输出重定向
- shell中的输出重定向
- shell输出重定向操作
- Shell 输入/输出重定向
- Shell 命令重定向输出
- Shell 输入/输出重定向
- shell基础-输出重定向
- shell 输入 输出重定向
- Shell输入/输出重定向
- Shell 输入/输出重定向
- Shell 输入/输出重定向
- Shell 输入/输出重定向
- Shell 输入/输出重定向
- Shell 输入/输出重定向
- shell 输入/输出重定向
- java虚拟机的运行机理
- 正则表达式常用实例
- Android UI控件三
- QQ2013协议分析(一)准备工作
- Opencv通过摄像头画框
- python 重定向shell执行输出
- Myeclipse10下载,安装,破解,插件,优化介绍
- strcpy函数与memcpy函数(区别及实现)
- DB2 ONLINE UTILITY 监控
- Ubuntu下source insight安装
- struts中过滤器与拦截器的区别
- maven的部署、遇到的问题和心得体会
- 甘特图
- UVA 11995 I Can Guess the Data Structure!