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:

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

import tkinter as tkroot = tk.Tk() #line 2root.mainloop()

Save this with the .py file extension or check out the code present in the 1.01.py file. Open it in the IDLE window or run it from within your activated virtual environment using the following ...

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