开发者

mod_python equivalent to php exec() command

开发者 https://www.devze.com 2023-02-15 03:51 出处:网络
what is the mod_python equivalent to the php exec command? $cmd = \'/var/www/scripts/test.py\' + $parameter

what is the mod_python equivalent to the php exec command?

$cmd = '/var/www/scripts/test.py' + $parameter
$开发者_如何学Goreturn = exec($cmd)

I've tried this but it doesn't return anything

varReturn= subprocess.check_output(['/var/www/scripts/resolveID.py ', varParameters)


Capture the stdout and stderr of the subprocess:

from subprocess import Popen, PIPE

proc = Popen(['/var/www/scripts/resolveId.py', 'arg1', 'arg2'], stdout=PIPE, stderr=PIPE)
stdout, stderr = proc.communicate()
0

精彩评论

暂无评论...
验证码 换一张
取 消