-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpomodoro.py
71 lines (54 loc) · 2.25 KB
/
pomodoro.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from win10toast import ToastNotifier
import time
toaster = ToastNotifier()
# get task and sessions required and pass it to the clock
def task_n_session():
task = input('Please enter a task: ')
session = input('Please enter the number of sessions you need: ')
toaster.show_toast("Pomodoro Clock started!!",
"Let's do it :)")
pomodoro_clock(task, session)
# creating the pomodoro clock
def pomodoro_clock(task, session):
session_value = int(session)
# for 3 or lesser the break time will be 5 minutes only
if session_value < 4:
for i in range(session_value):
time.sleep(1200)
toaster.show_toast("Pomodoro Notifications!!",
"Break time :)")
time.sleep(300)
toaster.show_toast("Pomodoro Notifications!!",
"Back to work xD")
# if user needs more sessions for completion
more_sessions = input('Hey do you need more sessions ? [y/n] : ')
if more_sessions == 'y':
task_n_session()
else:
print('Congrats! You did a great Job :)')
# for every fourth clock the break time will be 20 minutes
else:
j = 1
for i in range(session_value):
if j % 4 != 0:
time.sleep(1200)
toaster.show_toast("Pomodoro Notifications!!",
"Break time :)")
time.sleep(300)
toaster.show_toast("Pomodoro Notifications!!",
"Back to work xD")
else:
time.sleep(1200)
toaster.show_toast("Pomodoro Notifications!!",
"Take 20min Break time :)")
time.sleep(1200)
toaster.show_toast("Pomodoro Notifications!!",
"Back to work xD")
j += 1
# if user needs more sessions for completion
more_sessions = input('Hey do you need more sessions ? [y/n] : ')
if more_sessions == 'y':
task_n_session()
else:
print('Congrats! You did a great Job :)')
task_n_session()