May 2017
Beginner to intermediate
444 pages
11h 31m
English
We will create a new Python module, and the following screenshot shows both the code and the resulting output:
GUI_StringVar.py

First, we import the tkinter module and alias it to the name tk.
Next, we use this alias to create an instance of the Tk class by appending parentheses to Tk, which calls the constructor of the class. This is the same mechanism as calling a function; only here, we create an instance of a class.
Usually, we use this instance assigned to the win variable to start the main event loop later in the code, but here, we are not displaying a GUI, rather, we are demonstrating how to use the tkinter StringVar ...
Read now
Unlock full access