Hi friends!
I want to create a countdown program. Here is my code:
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
import datetime
class CountdownApp(App):
def build(self):
delta = datetime.datetime(2015, 3, 21, 2, 15, 11) - datetime.datetime.now()
days = delta.days
days = str(days)
self.label_days = Label(text=days + " days")
hour_string = str(delta).split(', ')[1]
hours = hour_string.split(':')[0]
self.label_hours = Label(text=hours + " hours")
minuts = hour_string.split(':')[1]
self.label_minuts = Label(text=minuts + " minuts")
seconds = hour_string.split(':')[2]
self.label_seconds = Label(text=seconds + " seconds")
b = BoxLayout(orientation="vertical")
b.add_widget(self.label_days)
b.add_widget(self.label_hours)
b.add_widget(self.label_minuts)
b.add_widget(self.label_seconds)
return b
if __name__ == "__main__":
CountdownApp().run()
I want the program to update itself every seconds and then the label wich shows seconds should be updated every seconds....
How can i do that?