我有一个错误,当我使用passthru()调用python脚本子进程和管道)与PHP。passthru()+管子进程=回溯(最近一次调用最后一次):(...)在stdout = subprocess.PIPE)
以下是错误:
Traceback (most recent call last): File "…/Desktop/h.py", line 11, in stdout=subprocess.PIPE) #set up the convert command and direct the output to a pipe File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 593, in init errread, errwrite) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 1079, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory
的PHP中继:
<?php
passthru("/usr/bin/python2.5 /Users/Nagar/Desktop/h.py $argument1 $argument2 1 2>&1");
?>
我的Python线,导致该错误:
p1 = subprocess.Popen(['convert', fileIn, 'pnm:-'], stdout=subprocess.PIPE) #set up the convert command and direct the output to a pipe
如何使用标准输出= subprocess.PIPE在子流程中正确吗?
期待您的回答。