Passing queues among different modules
In this recipe, we will pass Queues
around different modules. As our GUI code increases in complexity, we want to separate the GUI components from the business logic, separating them out into different modules.
Modularization gives us code reuse and also makes the code more readable.
Once the data to be displayed in our GUI comes from different data sources, we will face latency issues, which is what Queues
solve. By passing instances of Queues
among different Python modules, we are separating the different concerns of the modules' functionalities.
Note
The GUI code ideally would only be concerned with creating and displaying widgets.
The business logic modules' job is to only do the business logic.
We have to ...
Get Python GUI Programming Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.