Integrate Python Qt-based GUI tools into console app
-
I am working in an application environment which is primarily based on running from a Python console, but into which I would like to integrate some simple optional GUI addon tools. The console environment exposes various application specific commands, some of which fire off long-running jobs. The GUI tools I have in mind would pop up windows to do things like display a streaming output log, or display charts to indicate progress of relevant quantities. The existing command set would be extended to allow the user to show these windows.
In principle, the GUI components I have in mind could be implemented using PySide, but the issue I foresee based on my current understanding is that any Qt GUI has to run in the main thread. Meanwhile, I think the console also has to run in the main thread, and I don't want the console to block while GUI windows are being shown.
Just looking to see if my understanding is correct, whether anyone has done something similar, and what possible approaches might be. Obviously, I have thought of a multiprocess type of approach, and that might have to be the solution, but it brings some additional complications that I would like to see if I can avoid.
-
Hi,
Do you have something like the iPython Qt console in mind ?
-
@SGaist thank you. What we have at the moment is a pretty vanilla console and I had been thinking about how to extend that with some limited GUI facilities. But the ipython route isn't something I had considered and I wasn't aware of the Qt console. It would be a change of direction but certainly something to consider and investigate. Thanks again.