Tkinter is Python’s standard, platform-independent interface to the Tcl/Tk toolkit for building desktop graphical user interfaces. Its widgets—such as labels, text boxes, and buttons—respond to user actions by calling Python functions. section 7.4.1
A Tkinter application runs inside its own event loop. Calling window.mainloop() keeps redrawing the window and processing widget events, so long-running work inside a callback freezes the interface until that work finishes. section 7.4.1 section 7.4
A button-driven window
Create a window, configure its title and size, place a ttk.Button, connect the button to say_hello, and start the application with window.mainloop(). Clicking the button prints “Hello there!”; adding time.sleep(10) to the callback demonstrates why blocking work is dangerous.
Responsive applications keep the Tkinter event loop in the main thread and run an asyncio event loop in a separate thread. User actions can submit coroutines without blocking, while progress updates travel back to the interface; thread communication still requires care around race conditions and thread safety. section 7.4.2 section 7.6


