There are built-in programming types in tkinter that differ slightly from the Python types we are used to programming with. StringVar() is one such tkinter type. This recipe will show you how to use the StringVar() type.
How to use StringVar()
Getting ready
In this recipe, you will learn how to save data from the tkinter GUI into variables so we can use that data. We can set and get their values, which is very similar to how you would use the Java getter/setter methods.
Here are some of the types of code in tkinter:
strVar = StringVar() | Holds a string; the default value is an empty string ("") |
intVar = IntVar() | Holds an integer; the default value is 0 |
dbVar = DoubleVar() | Holds a float; the default value is... |