18.2. Tkinter and Python Programming

18.2.1. Tkinter Module: Adding Tk to your Applications

So what do you need to do to have Tkinter as part of your application? Well, first of all, it is not necessary to have an application already. You can create a pure graphical user interface if you want, but it probably isn't too useful without some underlying software that does something interesting.

There are basically five main steps that are required to get your GUI up-and-running:

1.
Import the Tkinter module (or from Tkinter import *).
2.
Create a top-level windowing object which contains your entire GUI application.
3.
Built all your GUI components (and functionality) on top (or “inside”) of your top-level windowing object).
4.
Connect these GUI components ...

Get Core Python Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.