3 ValueError: dictionary update sequence element #0 has length 3; 2 is required 1
Question: I am using tkinter and trying to create a library of frames instead of having
my program open new windows every time. I have begun creating a welcome page
and I am trying to display what I have created only for it to give me this
error message. "ValueError: dictionary update sequence element #0 has length
1; 2 is required" Here is my code:

    
    
    #!/usr/bin/python
    
    
    from tkinter import *
    
    import tkinter as tk
    
    
    Large_Font = ("Verdana", 18)
    
    class ATM(tk.Tk):
        def __init__(self, *args, **kwargs):
            tk.Tk.__init__(self, *args, **kwargs)
            container = tk.Frame(self)
    
            container.pack(side = "top", fill ="both", expand =True)
    
            container.grid_rowconfigure(0, weight=1)
            container.grid_columnconfigure(0, weight=1)
    
            self.frames = {}
    
            for i in (WelcomePage, Checking):
    
                frame = i(container, self)
                self.frames[i] = frame 
                frame.grid(row= 0, column = 0, sticky= "nsew")
    
            self.show_frame(WelcomePage)
    
    
        def show_frame(self, cont):
            frame = self.frames[cont]
            frame.tkraise()
    
    class WelcomePage(tk.Frame): 
        def __init__(self, parent, controller):
            tk.Frame.__init__(self, parent)
            self.controller = controller
            label = tk.Label(self, "Welcome to the ATM Simulator", font = Large_Font)
            label.pack(pady=100, padx=100)
    
            checkButton = Button(self, text = "Checking Account", 
                                 command = lambda: controller.show_frame(Checking))
            checkButton.pack()
    
    
    class Checking(tk.Frame):
        def __init__(self, parent, controller):
            tk.Frame.__init__(self, parent, controller)
            self.controller = controller
            label = tk.Label(self, "Welcome to the ATM Simulator", font = Large_Font)
            label.pack(pady=100, padx=100)
    
            homeButton = Button(self, text = "Back to Home Page", 
                                 command = lambda: controller.show_frame(WelcomePage))   
            homeButton.pack()
    app = ATM()
    app.mainloop()
    

The error message is occurring because I state that

`frame = i(container, self)`

but when I create the class I state

`class WelcomePage(tk.Frame):`

The dictionary element in my WelcomePage class only has 1 parameter but I need
two. I tried putting `self` as the second parameter but that did not work.
This worked in Python 3.4 but now that I am using Python 3.5 it gives me this
error. How would I fix this?


Answer: 
    class Checking(tk.Frame):
        def __init__(self, parent, controller):
            tk.Frame.__init__(self, parent, controller)
    

I don't think `Frame`'s initializer can accept that many arguments unless
`controller` is a dictionary. Try:

    
    
    class Checking(tk.Frame):
        def __init__(self, parent, controller):
            tk.Frame.__init__(self, parent)
    

You should also use the `text` named argument to specify the text for your
labels.

    
    
        label = tk.Label(self, text="Welcome to the ATM Simulator", font = Large_Font)
    

