I am trying to add a GUI to a Python program that controls a measurement instrument. When the program is started, it automatically connects and configures the instrument. This process takes many seconds or a few minutes, so it must not be handled within the event loop of the new GUI. The process prints a bunch of messages that need to be shown in the GUI window.
So far, I put the event loop of the wxPython GUI at the core of my program. Now I need to figure out the following:
(1) How do I start the process to connect/configure the instrument outside of the event loop?
(2) How do I redirect the process messages to the GUI (I found this, but I don’t know if it’s the right way to go: https://www.blog.pythonlibrary.org/2009/01/01/wxpython-redirecting-stdout-stderr )
As a newbie to wxWidgets I am not sure where to look. Some pointers or a (pseudo) example would be great!
Thanks!