Python: __init__() takes 2 positional arguments but 3 were given Python: __init__() takes 2 positional arguments but 3 were given tkinter tkinter

Python: __init__() takes 2 positional arguments but 3 were given


I think this is the line that is causing the issue, you cannot pass the self instance to the constructor.

frame = F(self, container)

Can you please check and add more information to the question to understand what you are trying to achieve.


You can just add in __init__ one more argument, controller.

This works for me:

def __init__(self, master, controller):    tk.Frame.__init__(self, master)