Skip to content

Instantly share code, notes, and snippets.

@spiridonovpolytechnic
Created November 17, 2016 02:18
Show Gist options
  • Save spiridonovpolytechnic/e0a26f825898785ce36e0374b721c94a to your computer and use it in GitHub Desktop.
Save spiridonovpolytechnic/e0a26f825898785ce36e0374b721c94a to your computer and use it in GitHub Desktop.
Dictionary driven kivy Label
class LabelD(Label):
def __init__(self,dictionary,key_string,**kwargs):
super(LabelD, self).__init__(**kwargs)
self.dictionary = dictionary
self.key_string = key_string
Clock.schedule_interval(self.update, 1 / 30.)
def update(self, *args):
self.text = str(self.dictionary[self.key_string])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment