May 2017
Beginner to intermediate
444 pages
11h 31m
English
We will assign a value from our GUI to a Python variable.
Add the following code towards the bottom of our module, just above the main event loop:
strData = spin.get() print("Spinbox value: " + strData) # Place cursor into name Entry name_entered.focus() #====================== # Start GUI #====================== win.mainloop()
Running the code gives us the following result:

We will retrieve the current value of the Spinbox control.
Read now
Unlock full access