什么是mod_python的等同于PHP的exec命令?
$cmd = '/var/www/scripts/test.py' + $parameter
$return = exec($cmd)
我试过,但它不返回任何东西
varReturn= subprocess.check_output(['/var/www/scripts/resolveID.py ', varParameters)
什么是mod_python的等同于PHP的exec命令?
$cmd = '/var/www/scripts/test.py' + $parameter
$return = exec($cmd)
我试过,但它不返回任何东西
varReturn= subprocess.check_output(['/var/www/scripts/resolveID.py ', varParameters)
捕获子进程的输出和错误:
from subprocess import Popen, PIPE
proc = Popen(['/var/www/scripts/resolveId.py', 'arg1', 'arg2'], stdout=PIPE, stderr=PIPE)
stdout, stderr = proc.communicate()