-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.py
More file actions
31 lines (26 loc) · 691 Bytes
/
timer.py
File metadata and controls
31 lines (26 loc) · 691 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
#!/usr/bin/env python3
import time
import datetime
import os
from win11toast import toast # type: ignore
h = 0
m = 25
s = 0
def clear_console():
os.system('cls')
def countdown(h, m, s):
while True:
total_seconds = h * 3600 + m * 60 + s
while total_seconds > 0:
timer = datetime.timedelta(seconds= total_seconds)
print(timer, end="\r")
time.sleep(1)
total_seconds -= 1
print("Get Up ")
toast('Get Up ',
'Take a break then click to continue...',
scenario='incomingCall',
button='Dismiss'
)
clear_console()
countdown(int(h), int(m), int(s))