-
Notifications
You must be signed in to change notification settings - Fork 0
/
notifier.py
49 lines (32 loc) · 1.14 KB
/
notifier.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from plyer import notification
import time
if __name__ == '__main__':
deccesion = input("Enter what type of notification you want ['Drink' or 'Rest']: ")
def ShowNotification(title, message, timeout):
notification.notify(
title=title,
message=message,
timeout=timeout
)
return "Successful"
if "drink" in deccesion:
a = True
while a:
titles = "Drink one glass of water"
messages = "According to the Harvard University. A programmer should drink one glass of water in every 2 hours."
timeouts = 10
ShowNotification(titles, messages, timeouts)
time.sleep((60*60)*2)
elif "rest" in deccesion:
a = True
while a:
titles = "Take rest for 10 minutes"
messages = "According to the Harvard University. A programmer should take rest in every 1 hour."
timeouts = 10
ShowNotification(titles, messages, timeouts)
time.sleep((60*60)*2)
else:
titles = "You haven't choosen anything"
messages = "If you will not choose anything then this notification will came up. Please, Choose Rest or Drink."
timeouts = 15
ShowNotification(titles, messages, timeouts)