So im trying to use a method from another class but im having to add all the paramenters from the class im using the method from. is there anyway around this?
class MainPage(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
label = tk.Label(self, text = "aaaa")
label.pack(pady = 10, padx = 10)
A = managers()
method = getattr(A, printAll) ## "printAll" is the method im trying to get
addemployee = tk.Button(self, text = "Start", command = method)
addemployee.pack(pady = 10, padx = 10)
class managers(workers):
def __init__(self, firstname, surname, age, postcode, wage, Employees = None):
super().__init__(firstname, surname, age, postcode, wage)
def printAll(self): #### the method i want to use
for emp in self.employees:
print(emp.Fullname(), "-", emp.Age(), "-", self.Postcode(), "-", self.Wage())