December 2015
Beginner to intermediate
350 pages
6h 49m
English
We are extending the first recipe. We will leave the GUI resizable, so don't use the code from the second recipe (or comment the win.resizable line 4 out).
In order to add a Label widget to our GUI, we are importing the ttk module from tkinter. Please note the two import statements.
# imports # 1 import tkinter as tk # 2 from tkinter import ttk # 3
Add the following code just above win.mainloop() located at the bottom of recipes 1 and 2.
# Adding a Label # 4 ttk.Label(win, text="A Label").grid(column=0, row=0) # 5
Running the code adds a label to our GUI:

In line 3 of the above ...
Read now
Unlock full access