[Python] How to use progress bar in kivy which displays progress of installation?

Discussão em 'Python' iniciado por Stack, Maio 19, 2025.

  1. Stack

    Stack Membro Participativo

    I have designed a simple GUI which I have not developed so much but once I will complete I need GUI to display even the progress of application that what is it doing suppose in my exe it has many steps like reading csv, searching input, etc all such steps are to be displayed on screen and even the progress bar with green or blue color to be displayed that will show how much is remaining or completed. Is it possible in Kivy python. This is my code in Kivy GUI:

    from kivy.lang import Builder
    from kivy.uix.floatlayout import FloatLayout
    from kivy.properties import StringProperty
    from kivy.uix.spinner import Spinner
    from kivy.app import App


    Builder.load_string('''
    <MainScreen>:
    GridLayout:
    orientation: 'vertical'
    cols: 1
    canvas.before:
    Color:
    rgba: 1, 1, 1, 1
    Rectangle:
    pos: self.pos
    size: self.size
    GridLayout:
    orientation: 'vertical'
    cols: 2
    Spinner:
    id: first
    text: ' First Number'
    values: ['1','2','3','4','5','6','7','8','9']
    Spinner:
    id: second
    text: ' Second Number'
    values: ['1','2','3','4','5','6','7','8','9']
    Label:
    id: result
    text: ' Result'
    color: 0,0,0,1
    Button:
    id: res
    on_press: root.onPow(first.text,second.text)
    text: 'Progress'
    ''')

    class MainScreen(FloatLayout):
    changet = StringProperty()
    def __init__(self, **kwargs):
    super(MainScreen, self).__init__(**kwargs)
    def onPow(self,fir,sec):
    a = 0
    b = 0
    for i in range((10000)):
    print(b)
    self.ids.result.text=str(b*(int(fir)*int(sec)+i))
    b+=1
    class TestApp(App):
    def build(self):
    return MainScreen()

    if __name__ == "__main__":
    TestApp().run()


    And when I run this code buttons are of bigger size I need them to be small as per their text or all the butoons of same size. Thank you

    Progress bar image

    sample image of what I need

    [​IMG]

    Continue reading...

Compartilhe esta Página