-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise_7.py
41 lines (39 loc) · 1.22 KB
/
exercise_7.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
import datetime
import pyttsx3
import time
import sys
org = sys.stdout
def date():
return datetime.datetime.now()
while True:
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice',voices[1].id)
engine.setProperty('rate',180)
# this is the driver code from here
engine.say("good morning sir please do some exercise")
engine.runAndWait()
time.sleep(2)
with open ("exercise.txt",'a') as file:
answer = input("\ninput here in done and no :- ")
sys.stdout = file
print(date())
sys.stdout = org
engine.say("good morning sir please do some water")
engine.runAndWait()
time.sleep(2)
with open ("exercise.txt",'a') as file:
answer = input("\ninput here in done and no :- ")
sys.stdout = file
print(date())
sys.stdout = org
engine.say("good morning sir please do some eye exercise")
engine.runAndWait()
time.sleep(2)
with open ("exercise.txt",'a') as file:
answer = input("\ninput here in done and no :- ")
sys.stdout = file
print(date())
sys.stdout = org
if answer == 'done':
break