Aug-07-2018, 08:35 AM
main.py
from kivy.app import App from kivy.properties import StringProperty import values class MainApp(App): label_text = StringProperty() def build(self): self.label_text = values.label_text def increment(self): self.label_text = str(int(self.label_text) + 1) def decrement(self): self.label_text = str(int(self.label_text) - 1) if __name__ == '__main__': MainApp().run()main.kv
Output:BoxLayout:
orientation: "vertical"
Label:
text: app.label_text
Button:
text: "increment"
on_press: app.increment()
Button:
text: "decrement"
on_press: app.decrement()
values.pylabel_text = "0"However I would use kivy.config and eventually add kivy.settings to initialize and have settings shown to user
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs