Skip to content
Advertisement

How to access Python Variables from parent Tkinter

I have a Tkinter App and currently I am trying to split the code from each tab to be on each tab. I can pass the string as a parameter into the Tab but is it possible to access the parent variables from the child ttk.Frame ? The actual code has more things.

JavaScript

Advertisement

Answer

The easiest solution is to pass the instance of App to each tab. With that, the tab has access to anything defined in App.

It looks something like this:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement