Nov-17-2019, 10:55 PM
Hi all,
I have a parent module that imports various other modules and runs a “While True” loop within it.
I’m essentially building a spotify radio clock with the Parent module and a UI module that gets commands depending on input on the interface.
- The parent calls a UI.window.update() to refresh the TKinter.
Currently I am using a messy setup where the parent module checks whether a variable is “None” otherwise executes a command based on whatever string that “None” is replaced with.
A more optimal solution would be for the UI class to be able to run a function in the parent. Lets say for example “play music”.
What is the best way for two modules to work but with one slave child module to have the ability to run functions in the master function?
If I use a double import then things get messy with circular referencing etc...
I have a parent module that imports various other modules and runs a “While True” loop within it.
I’m essentially building a spotify radio clock with the Parent module and a UI module that gets commands depending on input on the interface.
- The parent calls a UI.window.update() to refresh the TKinter.
Currently I am using a messy setup where the parent module checks whether a variable is “None” otherwise executes a command based on whatever string that “None” is replaced with.
A more optimal solution would be for the UI class to be able to run a function in the parent. Lets say for example “play music”.
What is the best way for two modules to work but with one slave child module to have the ability to run functions in the master function?
If I use a double import then things get messy with circular referencing etc...