Mar-20-2020, 04:50 AM
(This post was last modified: Mar-20-2020, 06:37 AM by deanhystad.)
I am trying to figure out how best to provide access to a python interpreter from inside a GUI based program. The GUI is the interface for a process controller. Starting the GUI can take a long time because it involves booting multiple subsystems and turning on machinery in the proper sequence with lots of waiting for things to complete. If something goes wrong I would like a way to peek around inside the controller and maybe even try a patch before shutting things down and having to restart.
Looking for "embedded console", "gui console", "interactive interpreter", "python terminal" has pointed me to code.InteractiveConsole which is exactly what I want, except I don't see how I can hook this to a text editor widget inside the GUI. I am using Qt Widgets (PySide2), so QtConsole popped up, but that is about 100 times more powerful than I need and can I even use it outside of Jupyter?
I'd appreciate any suggestions or paths to pursue in my investigations. If you think my approach to solving this problem is off track I would appreciate hearing that too. I'm a C, C++, C# programmer and a lot of Python catches me off guard. Maybe I am completely backward (again) and I should be thinking of using a tool outside my GUI application instead of trying to shoehorn one into it.
Looking for "embedded console", "gui console", "interactive interpreter", "python terminal" has pointed me to code.InteractiveConsole which is exactly what I want, except I don't see how I can hook this to a text editor widget inside the GUI. I am using Qt Widgets (PySide2), so QtConsole popped up, but that is about 100 times more powerful than I need and can I even use it outside of Jupyter?
I'd appreciate any suggestions or paths to pursue in my investigations. If you think my approach to solving this problem is off track I would appreciate hearing that too. I'm a C, C++, C# programmer and a lot of Python catches me off guard. Maybe I am completely backward (again) and I should be thinking of using a tool outside my GUI application instead of trying to shoehorn one into it.