goldilocks
0
Q:

python tkinter change color of main window

#Import:
from tkinter import *

#Create Window:
new_window = Tk()
new_window.title("Hello World")
new_window.geometry("300x250")
#Adding the background color:
new_window.config(bg = "red")

#new_window tells us that we are setting up something for the new window
#.config() means that we want to configure something on the screen
#bg tells that the background needs to be changed
#"red" tells us what should the background color be ; it can also be a hex code

new_window.mainloop()
0

new_window.config(bg = "red")
0
imporrt tkinter as tk
root = Tk.Tk()
root.config(bg="#write you colour here")
root.mainloop()
0

New to Communities?

Join the community