[問題] python 執行 shell script
板友們好
我在一個 web script 寫一個執行 shell 指令
cmd=subprocess.Popen(['./create_tunnel.sh','%s'%tunnel_name],stdout=subprocess.PIPE, stderr=subprocess.PIPE)
它是可以把 tunnel_name 變數當作 create_tunnel.sh 的參數丟進去
但我要怎麼丟兩個參數阿? 試過
cmd=subprocess.Popen(['./create_tunnel.sh','%s %s'%tunnel_name %tunnel_name1]
沒有成功
謝謝。
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.251.223.31
※ 文章網址: http://www.ptt.cc/bbs/Python/M.1420695432.A.45E.html
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):