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()

 

  1. What is Google Opal? It’s a no-code / low-code AI mini-app builder developed by Google Labs. You describe what you want in natural ...