Showing posts with label python gui. Show all posts
Showing posts with label python gui. Show all posts

Thursday, July 17, 2025

Change the background color of a simple GUI using Tkinter in Python

import tkinter as tk


def change_bg():

    root.config(bg="lightblue")  # Change background color


root = tk.Tk()

root.geometry("200x100")

btn = tk.Button(root, text="Change Background", command=change_bg)

btn.pack(pady=20)

root.mainloop()

 

Learn Coding

  A well-designed course should progress through three structured levels: beginner, intermediate, and advanced. At the beginner level, the f...