How to Set Tkinter Backgroud Color

Tkinter widget class method configure and attribute bg or backgroud could be used to set the Tkinter widget/window background color.

Method configure(background= )

try:
    import Tkinter as tk
except:
    import tkinter as tk
    

    
app = tk.Tk()
app.title("configure method")
app.geometry('300x200')

app.configure(bg='red')
app.mainloop()

Here,

app.configure(bg='red') configures the background color of app to be red. You could also use background instead of bg.

app.configure(background='red')

How to set Tkinter Background Color - configure method

Attribute bg or background

background or bg is one attribute in most of Tkinter widgets, and could be used to set the background color directly.

try:
    import Tkinter as tk
except:
    import tkinter as tk
    

    
app = tk.Tk()
app.title("bg attribute")
app.geometry('300x200')

app['bg'] = 'blue'
app.mainloop()

How to set Tkinter Background Color - bg attribute