我使用网络摄像头创建了一个应用程序.在这里,我的应用程序打开一个窗口来显示图像.我想在启动时运行该应用程序.如果我将启动文件放在 rc.local 中,它会在启动时成功运行但不允许显示窗口.它显示 -
I have created an application using webcam. here my application opens a window to display the image. I want to run that application on startup. if i put startup file in rc.local, it runs successfully at startup but not allowing to show window. it shows -
gtk warning cannot open display.如何显示窗口?请大家帮帮我!!
how to show window? please help me guys!!
推荐答案如果您运行的是 LXDE(raspbian 上的默认设置)
If you're running LXDE (default on raspbian)
将 .desktop 文件添加到您的 ~/.config/autostart 目录(如果不可用,请创建一个),其中包含 3 行内容:
Add a .desktop file to your ~/.config/autostart directory (create one if not available) with 3 lines saying :
[Desktop Entry] Type=Application Exec=python /path/to/your/application.py arguments更新:更新了唐问题的评论
UPDATE: updated with Don Question's remark
更多推荐
在启动时运行 python 脚本
发布评论