Posted in Python onJanuary 04, 2017
import subprocess
output =Popen(["mycmd","myarg"], stdout=PIPE).communicate()[0]
import subprocess
p = subprocess.Popen(['ls','-a'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
print out
# work on Unix/Linux only
import commands
print commands.getstatusoutput('wc -l file')[1]
以上就是小编为大家带来的python 捕获shell脚本的输出结果实例全部内容了,希望大家多多支持三水点靠木~
python 捕获shell脚本的输出结果实例
- Author -
jingxian声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@