import tkinter as tk
- Simple Program with Button Command:
def button_click():
label.config(text="Button Clicked!")
root = tk.Tk()
root.title("Button Example")
label = tk.Label(root, text="Click the button")
label.pack()
button = tk.Button(root, text="Click Me", command=button_click)
button.pack()
root.mainloop()
Output:
No comments:
Post a Comment