import subprocess
output =Popen(["mycmd","myarg"], stdout=PIPE).communicate()[0]
import subprocess
p = subprocess.Popen(['ls's.Popena' ], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
print out
# work on Unix/Linux only
-l file')[1]
以上就是小編為大家帶來的python 捕獲shell腳本的輸出結果實例全部內容了,希望大家多多支持PHP中文網~
更多python 捕獲shell腳本的輸出結果實例相關文章請關注PHP中文網!