I have some time-consuming Python script that has a cycle with about 1000 iterations (each step takes about one minute). I want to plot the results of each iteration to make sure that my code works correctly.
I can use matplotlib, but in non-blocking mode it does respond to GUI events (for example, window minimize/maximize), so I need to run an extra GUI message loop, for example, Qt one. And the simplest way to do it is the following:
- refactor my calculations and wrap them into a QObject;
- move it to a separate QThread
- make a QApplication
- wrap my plots into a QWidget
- connect the widget with the mathematics via signals and slots
- finally see the desired plot updates after each step and not need to wait to next iteration if windows is minimized.
But now is not 2009 but already 2019. And, I hope, there is some simpler way to get such an effect. Can you advice me something?