I will write simple code to understanding better , imagine we have 3 Button in kivy file like bellow code
kivy file:
Button:
text: A1
variable = 3
Button:
text : A2
variable = 2
Button:
text :A3
variable = 3
how I can put variable in kivy file when I prese on each button the variable change according value we defined, then deal with varable in python file
py file
def btn(self):
new_variable= variable+5