By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,441 Members | 1,573 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,441 IT Pros & Developers. It's quick & easy.

Starting a GUI application out of an console application

P: n/a
Hello!

I am currently working on an alternative for the gnome-volume-manager
for multiseat systems based on HAL and DBus. Whenever the signal
'DeviceAdded' is received I would like to start a GUI-Interface where
the user can choose from different options. But now I am wondering how I
should start this interface since this GUI must be started by a console
daemon. What is the most common way to do that?

Usually, I start a PyQt application that way:

app = QApplication(sys.argv)
ui = Dialog()
app.setMainWidget(ui)
ui.show()
app.exec_loop()

If I start it that way, I am not quite sure whether this will work since
I have got two main loops then (the one of console daemon [implemented
by using gobject.MainLoop().run()] and the Qt one). Moreover, once the
Qt application is started, it should run independently of the console
daemon.

Unfortunately, I can't think of any possibility to achieve this aim. Do
you have any suggestions?
Jul 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
put your gui application in another script and start it the same way
you'd start any other application whose exit status you didn't need:
os.popen* or subprocess.Popen.
or, use the threading module to give your qt application another
thread.
Fabian Steiner wrote:
Hello!

I am currently working on an alternative for the gnome-volume-manager
for multiseat systems based on HAL and DBus. Whenever the signal
'DeviceAdded' is received I would like to start a GUI-Interface where
the user can choose from different options. But now I am wondering how I
should start this interface since this GUI must be started by a console
daemon. What is the most common way to do that?

Usually, I start a PyQt application that way:

app = QApplication(sys.argv)
ui = Dialog()
app.setMainWidget(ui)
ui.show()
app.exec_loop()

If I start it that way, I am not quite sure whether this will work since
I have got two main loops then (the one of console daemon [implemented
by using gobject.MainLoop().run()] and the Qt one). Moreover, once the
Qt application is started, it should run independently of the console
daemon.

Unfortunately, I can't think of any possibility to achieve this aim. Do
you have any suggestions?
Jul 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.