-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
216 lines (181 loc) · 6.07 KB
/
main.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# Regular import
import os
import sys
import time
# Regular Functions
from Functions.RPS import RPS
from Functions.GTP import GTP
from Functions.GTN import GTN
from Functions.Greet import Greet
from Functions.Trivia import Trivia
from Functions.Weather import Weather
from Functions.ChatBot import ChatBot
from Functions.SetAlarm import SetAlarm
from Functions.PlaySong import PlaySong
from Functions.SendEmail import SendEmail
from Functions.LieSwatter import LieSwatter
from Functions.YouTubePlay import YouTubePlay
from Functions.ProjectBase import takeCommand
from Functions.GoogleSearch import GoogleSearch
from Functions.YouTubeSearch import YouTubeSearch
from Functions.NewsHeadlines import NewsHeadlines
# Miscellaneous Functions
from Functions.Miscellaneous.Quit import Quit
from Functions.Miscellaneous.Help import ShowHelp
from Functions.Miscellaneous.GetQuote import GetQuote
from Functions.Miscellaneous.AirQuality import GetAQI
from Functions.Miscellaneous.GetAdvice import GetAdvice
from Functions.Miscellaneous.OpenGoogle import OpenGoogle
from Functions.Miscellaneous.PasswordGen import PasswordGen
from Functions.Miscellaneous.OpenYoutube import OpenYoutube
from Functions.Miscellaneous.CurrentTime import CurrentTime
from Functions.Miscellaneous.TellmeaJoke import TellmeaJoke
from Functions.Miscellaneous.SendWhatsappMsg import SendWhatsappMsg
from Functions.Miscellaneous.WikipediaSearch import WikipediaSearch
# Greet Function
try:
Greet()
if not os.path.exists("Music"):
os.makedirs("Music")
elif not os.path.exists("Images"):
os.makedirs("Images")
except KeyboardInterrupt:
sys.exit()
# Main Code
while True:
try:
command = takeCommand()
if command:
if "open google" in command:
try:
OpenGoogle()
except KeyboardInterrupt:
sys.exit()
elif "open youtube" in command:
try:
OpenYoutube()
except KeyboardInterrupt:
sys.exit()
elif "time" in command in command:
try:
CurrentTime()
except KeyboardInterrupt:
sys.exit()
elif "joke" in command:
try:
TellmeaJoke()
except KeyboardInterrupt:
sys.exit()
elif "search on google" in command:
try:
GoogleSearch()
except KeyboardInterrupt:
sys.exit()
elif "search on youtube" in command:
try:
YouTubeSearch()
except KeyboardInterrupt:
sys.exit()
elif "play on youtube" in command:
try:
YouTubePlay()
except KeyboardInterrupt:
sys.exit()
elif "wikipedia" in command:
try:
WikipediaSearch()
except KeyboardInterrupt:
sys.exit()
elif "news" in command:
try:
NewsHeadlines()
except KeyboardInterrupt:
sys.exit()
elif "weather" in command:
try:
Weather()
except KeyboardInterrupt:
sys.exit()
elif "air quality" in command:
try:
GetAQI()
except KeyboardInterrupt:
sys.exit()
elif "play a song" in command:
try:
PlaySong()
except KeyboardInterrupt:
sys.exit()
elif "advice" in command:
try:
GetAdvice()
except KeyboardInterrupt:
sys.exit()
elif "quote" in command:
try:
GetQuote()
except KeyboardInterrupt:
sys.exit()
elif "whatsapp" in command:
try:
SendWhatsappMsg()
except KeyboardInterrupt:
sys.exit()
elif "email" in command:
try:
SendEmail()
except KeyboardInterrupt:
sys.exit()
elif "password" in command:
try:
PasswordGen()
except KeyboardInterrupt:
sys.exit()
elif "alarm" in command:
try:
SetAlarm()
time.sleep(1.3)
except KeyboardInterrupt:
sys.exit()
elif "rock paper and scissors" in command:
try:
RPS()
except KeyboardInterrupt:
sys.exit()
elif "guess the pokemon" in command:
try:
GTP()
except KeyboardInterrupt:
sys.exit()
elif "guess the number" in command:
try:
GTN()
except KeyboardInterrupt:
sys.exit()
elif "lie catcher" in command:
try:
LieSwatter()
except KeyboardInterrupt:
sys.exit()
elif "trivia" in command:
try:
Trivia()
except KeyboardInterrupt:
sys.exit()
elif "chatbot" in command:
try:
ChatBot()
except KeyboardInterrupt:
sys.exit()
elif "help" in command:
try:
ShowHelp()
except KeyboardInterrupt:
sys.exit()
elif "shutdown" in command:
try:
Quit()
except KeyboardInterrupt:
sys.exit()
except KeyboardInterrupt:
sys.exit()