作者Arton0306 (Ar藤)
看板Python
标题[问题] 从cgi呼叫popen
时间Thu Oct 15 04:22:46 2009
我原本有支程式其中有下面两行
runAlign=Popen("runpsipred_single "+fileallname, shell=True)
runAlign.wait()
runpsipred_single是一个script小程式
在freebsd下执行的
原本这样写是可以跑的 (会产生一个输出档)
但当我把程式改成从网页执行时(用cgiwrap)就不能跑了
没产生输出档 但这两行不会有错误通知
不知用cgi时 Popen是不是需要改变成什麽样子??
====================================================================
我在想会不会是shell的关系
所以把shell拿掉 不过被挡住了 以下是错误讯息
Traceback (most recent call last):
File "test1.py", line 12, in <module>
runAlign=Popen("runpsipred_single spg", stdout=open("stdout.txt","w"))
File "/usr/local/lib/python2.5/subprocess.py", line 594, in __init__
errread, errwrite)
File "/usr/local/lib/python2.5/subprocess.py", line 1097, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
因为主机不是我管的 不知这样要请网管开启什麽权限呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.135.140.149
※ 编辑: Arton0306 来自: 220.135.140.149 (10/16 01:01)
※ 编辑: Arton0306 来自: 220.135.140.149 (10/16 01:19)
1F:推 dingyuchi:suid 4755 10/17 20:29