Kivy — it is a platform independent GUI tool in Python. Since it can run on Android, IOS, Linux, Windows, etc. It is mainly used to develop Android application, but that does not mean that it cannot be used in desktop applications.
To work with a spinner, you need to import:
from kivy.uix.spinner import Spinner
Spinner — it is a widget that provides a quick way to select one value from a set. In the default state, the counter shows its currently selected value. Touching the counter displays a drop-down menu with all other available values from which the user can select a new one.
As in the combo box, the counter object can have multiple values, and you can select one of the values.
A callback can be attached to the spinner object to receive notifications about the selection of a value from the spinner object.
Basic Approach: 1) import kivy 2) import kivyApp 3) import Label 4) import Spinner 5) import Floatlayout 6) Set minimum version (optional) 7) create App class: 1) Create the spinner 2) Attach the labels to spinners 3) Attach a callback also 8) return Layout / widget / Class ( according to requirement) 9) Run an instance of the class
Simple spinner implementation:
Now, if we need to tell the user every time which item in the list is selected, we will display a label next to the spinner that says about the selected label. We will also print out the value and text of the counter.
Below is the implementation: