[問題] python 執行 shell script

作者: gn00618777 (非常念舊)   2015-01-08 13:37:08
板友們好
我在一個 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]
沒有成功
謝謝。

Links booklink

Contact Us: admin [ a t ] ucptt.com