-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstApp.py
More file actions
31 lines (22 loc) · 739 Bytes
/
FirstApp.py
File metadata and controls
31 lines (22 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.lang import Builder
from kivy.clock import Clock
import time
Builder.load_file('myApp.kv')
class ClockScreen(Widget):
pass
class FirstApp(App):
def build(self):
return ClockScreen()
def on_start(self):
Clock.schedule_interval(self.updateClock, 1)
def updateClock(self, *args):
print(args)
#create time variable, if var doesnt work here create it in the ClockScreen class and call it here
hour = time.strftime("%H")
minute = time.strftime("%M")
clockTime = f'{hour}:{minute}'
#update label
self.root.ids.clock.text = clockTime
FirstApp().run()