【发布时间】:2013-07-16 01:11:16
【问题描述】:
我尝试过同时使用 subprocess() 和 os.system()
import os
def whatever(request):
open file
code write to file
close file
os.system(command theFileIwroteto argument)
现在代码很好。我已经打开了 python 并从字面上复制并粘贴了确切的命令,它工作正常。
蟒蛇:
import os
os.system(command theFileIwroteto argument)
为什么它可以使用 python shell 工作,但拒绝从 django 视图文件执行?
【问题讨论】:
-
如何运行视图?您将其标记为 apache,这会让我认为您将其作为 wsgi 运行(而不是 django 开发服务器等)。您在运行什么操作系统?
-
你收到
IOError: sys.stdout access restricted by mod_wsgi了吗?