-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.py
36 lines (31 loc) · 1.16 KB
/
test.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
import webbrowser
import time
def take_break():
print('one break comes after two hours\n')
num_breaks = int(input('how many breaks do you want?: '))
break_duaration = int(
input('After how many hours do you need the break?: '))
breaks = 0
while (num_breaks > breaks):
uin = break_duaration
when_to_stop = abs(int(uin))
while when_to_stop > 0:
m, s = divmod(when_to_stop, 60)
h, m = divmod(m, 60)
time_left = str(h).zfill(2) + ":" + \
str(m).zfill(2) + ":" + str(s).zfill(2)
print(time_left + "\r", end="")
time.sleep(1)
when_to_stop -= 1
while when_to_stop == 0:
accept = input("accept the break(Y/N): ")
if accept.upper() == 'Y':
print("when done with break hit enter\n")
webbrowser.open(
"https://www.youtube.com/watch?v=m7Bc3pLyij0",
new=0, autoraise=True)
else:
break
num_breaks -= 1
print("No more breaks for you today, Goodbye. See you again")
take_break()