//файл Python
class MyApp(App):
def build(self):
Builder.load_file('widgets.kv')
return CountryLists()
класс CountryLists(Widget):
def CountryList(self):
return pd.read_csv('./data.csv')['Country'].tolist()
if name == 'main< /strong>':
MyApp().run()
// файл .kv
:
Код: Выделить всё
Spinner:
id: spinner1
text: 'select country'
values: root.countryList()
font_size: 24
bold: True
pos_hint: {"center_x": 0.5, "center_y": 0.5}
anchor: 'center'
введите описание изображения здесь
Подробнее здесь: https://stackoverflow.com/questions/790 ... er-in-kivy
Мобильная версия