I want to exchange line 18 text with line 23 lable text, but here line 18 doesn't work in my code? Any idea?!
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
def timer():
delta = datetime.datetime(2015, 3, 21, 2, 15, 11) - datetime.datetime.now()
days = delta.days
hour_string = str(delta).split(', ')[1]
hours = hour_string.split(':')[0]
minuts = hour_string.split(':')[1]
seconds = hour_string.split(':')[2]
seconds_1 = hour_string.split(':')[2].split('.')[0]
#print ("%s days" % days)
#print ("%s hours" % hours)
#print ("%s minuts" % minuts)
#print ("%s seconds" % seconds)
self.l_days.text = days
class CountdownApp(App):
def build(self):
b = BoxLayout()
l_days = Label(text = "days")
l_hours = Label(text = "hours")
l_minuts = Label(text = "minuts")
l_seconds = Label(text = "seconds")
b.add_widget(l_days)
b.add_widget(l_hours)
b.add_widget(l_minuts)
b.add_widget(l_seconds)
return b
if __name__ == "__main__":
CountdownApp().run()