from tkinter import *
from tkinter import ttk

# 1. Define the callback function
def handle_click():
    print("Button was clicked!")

root = Tk()
ttk.Button(root, text="Hello World", command=handle_click).grid()
root.mainloop()
