Python Forum

Full Version: Create buttons as many as there is data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, with this code I create a graphical interface with a button
from kivymd.app import MDApp
from kivy.lang import Builder

KV = """
Screen:

    MDRectangleFlatButton:
        text: "Hello Kivy World!"
        pos_hint: {"center_x": 0.5, "center_y": 0.5}
"""


class MainApp(MDApp):

    def build(self):
        self.title = "Hello Kivy"
        self.theme_cls.theme_style = "Dark"
        self.theme_cls.primary_palette = "Red"
        return Builder.load_string(KV)


MainApp().run()
however the application takes the data from the bees of a website so I would like to create as many buttons as the extracted data for example if the application extracts 5 data it must create 5 buttons if it extracts 8 data it must create 8 buttons and in the text of each button must put the extracted data, is it possible to do something like this?
thank you