[web2py] Re: Run linux ssh script

2015-04-15 Thread Gary Cowell
I might be inclined (have done, in fact) to use a python ssh implementation to do this, rather than using shell. paramiko would be one such module, 'spur' module is easier to use. Not using shell gives the python greater control over error handling and recovery, among other things. Of course,

[web2py] Re: Run linux ssh script

2015-04-14 Thread 黄祥
please try in your controller : import subprocess def ssh_script(): command = "applications/administrator/static/script/linux/ssh.sh" proc = subprocess.Popen(command, stdout = subprocess.PIPE, stderr = subprocess.PIPE) output, err = proc.communicate() return locals() best regards, stifan -- Re