本文介绍了启动时运行python脚本 - debian的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用网络摄像头创建了一个应用程序。这里我的应用程序打开一个窗口来显示图像。我想在启动时运行该应用程序。如果我将启动文件放在rc.local中,它在启动时运行成功,但不允许显示窗口。它显示 - gtk警告无法打开显示。
如何显示窗口?请帮助我们!
解决方案如果您正在运行LXDE(默认为raspbian)
将.desktop文件添加到〜/ .config / autostart目录(如果不可用,请创建一个)3行说:
[桌面条目] Type =应用程序 Exec = python /path/to/your/application.py参数更新:更新Don问题的说明
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!!
解决方案If you're running LXDE (default on raspbian)
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 argumentsUPDATE: updated with Don Question's remark
更多推荐
启动时运行python脚本
发布评论