【发布时间】:2023-05-26 01:19:01
【问题描述】:
我正在尝试从 cgi python 脚本运行标准的 python os.system 调用。 这是教程的一部分,因此脚本非常简单。我正在尝试使用 Raspberry Pi 相机拍照并将其显示在网页中。
import os, sys
os.system('raspistill -o /var/www/images/image.jpg')
print "Content-type:text/html\r\n\r\n"
print '<html>'
print '<head>'
print '<title>Hello Word - First CGI Program</title>'
print '</head>'
print '<body>'
print '<h2>Hello Word! This is my first CGI program</h2>'
print '<img src="/var/www/images/image.jpg"/>'
print '</body>'
print '</html>'
运行系统命令(在浏览器中打开)时遇到的错误是:
* 未能打开 vchiq 实例”
我看到了另一个关于此的问题,它说 http 守护程序以错误的用户身份运行,但我不确定这意味着什么。 当我以标准用户身份运行脚本时,脚本运行良好。
【问题讨论】:
标签: python raspberry-pi lighttpd