I am using Tkinter to create a GUI. I have a class for setting up all my GUI elements and another class that does some functionality.
class class_one():
def method_one(self):
do_something()
class GUI()
def __init__(self):
button = Button(self, text="button", command=call_class_one_method)
button.pack()
def call_class_one_method(self):
c = class_one()
c.method_one()
Is this above code the correct way for calling other class methods or should I be instantiating the class in the GUI's __init__ method? Or perhaps something else?