如何自动启动python/pyside GUI

2024-10-03 13:17:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我创建了一个Pyside QT GUI应用程序(python2.7),规范的一部分是在系统启动时自动启动它。普通的init.d东西似乎不起作用,因为它是一个GUI应用程序。你知道吗

到目前为止,我已经尝试了x11init.d和xdgxyz.桌面解决方案,他们似乎不工作。你知道吗

你怎么解决这个问题?你知道吗

Pyside应用程序如何在系统启动时自动启动?你知道吗

(德比安喘息)


Tags: 规范应用程序initgui解决方案qt桌面pyside
2条回答

很奇怪init.d不起作用。您还可以尝试将命令添加到/etc/rc.local 这里有一些细节:https://unix.stackexchange.com/a/49635

The script /etc/rc.local is for use by the system administrator. It is executed after all the normal system services are started, at the end of the process of switching to a multiuser runlevel. You might use it to start a custom service, for example a server that's installed in /usr/local.

好吧,经过一个又一个小时的胡闹,我终于明白了。我实际上在GNOME中使用了内置的启动管理器。我以前试过,但没用。所以这次我创建了一个条目来启动gnome计算器。。内置计算器。你知道吗

然后我在~/.config/autostart/gnome中编辑了条目-计算器.桌面使用gedit(gedit~/.config/autostart/gnome)-计算器.桌面). 我将Exec=gnome calculator更改为Exec=python/home/me/我的应用程序.py你知道吗

而且很有效。你知道吗

是的,这是一个蹩脚的解决方案,它没有确定问题是什么,但这是一个开始。谢谢你的帮助。你知道吗

相关问题 更多 >