-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
51 lines (41 loc) · 1.66 KB
/
main.py
File metadata and controls
51 lines (41 loc) · 1.66 KB
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
import pyttsx3 as ptx
import time as t
engine = ptx.init()
i = 0
x = 130
count = 0
rate = engine.getProperty('rate')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
while True:
t.sleep(1200)
engine.setProperty('rate', x)
count += 1
times = count * 20
hour = times // 60
minute = times - (hour * 60)
if hour == 0:
engine.say(f"Sir, Your total screen time is {minute} minute.")
engine.runAndWait()
if hour >= 2:
engine.say(f"Please Sir, take a short breake. Over 2 hour sitting fornt of computer is dangerous for eyes, back and your mental health.")
engine.runAndWait()
elif minute == 0:
engine.say(f"Sir, Your total screen time is {hour} hour.")
engine.runAndWait()
if hour >= 2:
engine.say(f"Please Sir, take a short breake. Over 2 hour sitting fornt of computer is dangerous for eyes, back and your mental health.")
engine.runAndWait()
else:
engine.say(f"Sir, Your total screen time is {hour} hour and {minute} minute.")
engine.runAndWait()
if hour >= 2:
engine.say(f"Please Sir, take a short breake. Over 2 hour sitting fornt of computer is dangerous for eyes, back and your mental health.")
engine.runAndWait()
engine.say("Please take some break. To long time looking at computer screen is harmful for eyesight. These screen breaks help prevent eye strain.")
engine.runAndWait()
for i in range(3):
engine.setProperty('rate', 140)
t.sleep(2)
engine.say("Please Sir, take some breake.")
engine.runAndWait()