-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask1
68 lines (63 loc) · 2.06 KB
/
task1
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
import os
import pyttsx3
print()
print("\t\t\t\tTell me, what can I do for you?")
print("\t\t\t\t```````````````````````````````")
pyttsx3.speak("Tell me, what can I do for you?")
global y
def my():
if ("run" in x):
pyttsx3.speak("running " + y)
elif ("launch" in x):
pyttsx3.speak("launching " + y)
elif ("open" in x):
pyttsx3.speak("opening " + y)
else:
print("Nothing")
print()
while True:
x = input(" Enter: ").lower()
if ((("run" in x) or ("open" in x) or ("launch" in x)) and (("notepad" in x) or ("editor" in x))):
y = "notepad"
my()
os.system(y)
print(" ------------------------------------")
elif ((("run" in x) or ("open" in x) or ("launch" in x)) and (("explorer" in x) or ("fileexplorer" in x))):
y = "file explorer"
my()
os.system("explorer")
print(" ------------------------------------")
elif ((("run" in x) or ("open" in x) or ("launch" in x)) and ("chrome" in x)):
y = "chrome"
my()
os.system(y)
print(" ------------------------------------")
elif ((("run" in x) or ("open" in x) or ("launch" in x)) and (("ppt" in x) or ("powerpnt" in x) or ("powerpoint" in x))):
y = "powerpoint"
my()
os.system("powerpnt")
print(" ------------------------------------")
elif ((("run" in x) or ("open" in x) or ("launch" in x)) and (("winword" in x) or ("word" in x) or ("msword" in x))):
y = "MS Word"
my()
os.system("winword")
print(" ------------------------------------")
elif ((("run" in x) or ("open" in x) or ("launch" in x)) and (("excel" in x) or ("msexcel" in x))):
y = "MS excel"
my()
os.system("excel")
print(" ------------------------------------")
elif ((("run" in x) or ("open" in x) or ("launch" in x)) and (("paint" in x) or ("mspaint" in x))):
y = "MS paint"
my()
os.system("mspaint")
print(" ------------------------------------")
elif (("exit" in x) or ("close" in x) or ("terminate" in x)):
print("\n :) See you next time!")
pyttsx3.speak("See you next time")
break
else:
print(" :( Wrong Input!")
pyttsx3.speak("Wrong Input, try again")
print(" ------------------------------------")
print()