Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python D-Bus and Tkinter main loop integration

I have a Python app that uses Tkinter GUI and Twisted. Twisted has support for a Tkinter main loop, so the two are working together nicely.

Now I'd like to add some D-Bus code into the app. But looking at the docs, I can't see how to integrate D-Bus into the Tkinter main loop. The Python D-Bus tutorial says it has main loop support for:

  • glib main loop
  • Qt main loop

What would be involved in making Python D-Bus work with a Tkinter main loop?

like image 637
Craig McQueen Avatar asked Dec 05 '25 05:12

Craig McQueen


1 Answers

I didn't realise it, but there are several D-Bus bindings for Python besides python-dbus which is called the "reference implementation".

One is a D-Bus binding for Twisted. I've tried the usage example (minus the reactor.stop() call), and it worked fine in my app.

There is also some work being done on generalising Python event loops, in PEP 3156 asyncio. This will hopefully simplify things in future, once various Python frameworks add support for asyncio style event loops.

  • PEP 3156 for TKinter proposal
  • python-dbusx — D-Bus for PEP 3156
like image 64
Craig McQueen Avatar answered Dec 07 '25 19:12

Craig McQueen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!