The root window – your drawing board

GUI programming is an art, and like all art, you need a drawing board to capture your ideas. The drawing board that you will use is called the root window. Our first goal is to get the root window ready.

The following screenshot depicts the root window that we are going to create:

The root window – your drawing board

Drawing the root window is easy. You just need the following three lines of code:

from tkinter import *
root = Tk()
root.mainloop()

Save this with the .py file extension or check out the 1.01.py code. Open it in the IDLE window and run the program from the Run menu (F5 in IDLE). Running this program should generate a blank root window, ...

Get Tkinter GUI Application Development Blueprints 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.