August 2015
Intermediate to advanced
246 pages
4h 21m
English
Here we want to highlight an important difference between traditional Python coding and Kivy, and the usefulness of this change.
We need to remember the traditional form to declare properties in Python. Usually, if we want to declare a property in Python, we do something such as:
class MyClass(object):
def __init__(self):
super(MyClass,self).__init__()
self._numeric_var = 1
@property
def numeric_var(self):
return self._numeric_varWe are declaring a numeric one, whereas if we use MyClass().numeric_var in the Python shell, we get 1 in return.
Now, to declare this property in Kivy we follow these steps:
Read now
Unlock full access