I am currently working on a project that takes a camera stream and after doing image processing, adds some overlays to measure some features of the image.
I am using TKinter for window management, threads to liberate the main thread (showing the camera stream) from image processing (sometimes quite lengthy operations and also non-live-showing critical dependency) and recently I moved to modules as the “main” script was +1000 lines.
Here I needed to make a decision about how I manage the project because I am using the window to show some updated values from the image processing, so I am quite literally “transporting” the window between modules (sending it as an argument in the buttons) so I can update values of the window in the aforementioned modules. Here is a MWE of what I am doing:
main.py: