Having trouble changing background color in Python
Question: I'm practicing coding in Python. Here is what I am testing and messing around
with.

    
    
    import tkinter as tk
    from tkinter import ttk
    class gui_programming(tk.Tk):
        def __init__(self, *args, **kwargs):
            tk.Tk.__init__(self, *args, **kwargs)
            container = tk.Frame(self)
            container.pack(side="left", fill="both", expand=True)
            container.grid_rowconfigure(0, weight=1)
            container.grid_columnconfigure(0, weight=1)
            self.frames = {}
            for F in (StartPage, Page1):
                frame = F(container, self)
                self.frames[F] = frame
                frame.grid(row=0, column=0, sticky="nsew")
            self.show_frame(StartPage)
    
        def show_frame(self, cont):
            frame = self.frames[cont]
            frame.tkraise()
    
    
    class StartPage(tk.Frame):
        def __init__(self, parent, controller):
            tk.Frame.__init__(self, parent)
            frame =
            frame.config(bg="red")
    
    class Page1(tk.Frame):
        def __init__(selfself, parent, controller):
            tk.Frame.__init__(self, parent)
    
    app = gui_programming()
    app.geometry("400x200+10+10")
    app.mainloop()
    

However I am curious and stumped as to what frame should be set to so that I
can change the background color to something other than default.


Answer: `frame` shouldn't set to anything. The object itself is a frame:

    
    
    class StartPage(tk.Frame):
        def __init__(self, parent, controller):
            tk.Frame.__init__(self, parent)
            self.config(bg="red")
    

