11
11
# import modules
12
12
from datetime import datetime # datetime module supplies classes for manipulating dates and times
13
13
import subprocess # subprocess module allows you to spawn new processes
14
- master
14
+ # master
15
15
import pyjokes
16
16
import requests
17
17
import json
18
18
19
- == == == =
19
+ # =======
20
20
from playsound import * #for sound output
21
- master
21
+ # master
22
22
import speech_recognition as sr # speech_recognition Library for performing speech recognition with support for Google Speech Recognition, etc..
23
23
24
24
# pip install pyttsx3
@@ -79,7 +79,7 @@ def voice(p):
79
79
80
80
81
81
# Run Application with Voice Command Function
82
- only_jarvis
82
+ # only_jarvis
83
83
class Jarvis :
84
84
def __init__ (self , Q ):
85
85
self .query = Q
@@ -126,9 +126,9 @@ def get_app(self):
126
126
print (task )
127
127
return
128
128
129
- == == == =
129
+ # =======
130
130
def get_app (Q ):
131
- master
131
+ # master
132
132
if Q == "time" :
133
133
print (datetime .now ())
134
134
x = datetime .now ()
@@ -150,7 +150,7 @@ def get_app(Q):
150
150
subprocess .call (['cmd.exe' ])
151
151
elif Q == "browser" :
152
152
subprocess .call (['C:\Program Files\Internet Explorer\iexplore.exe' ])
153
- patch - 1
153
+ # patch-1
154
154
elif Q == "open youtube" :
155
155
webbrowser .open ("https://www.youtube.com/" ) # open youtube
156
156
elif Q == "open google" :
@@ -170,27 +170,27 @@ def get_app(Q):
170
170
except Exception as e :
171
171
print (e )
172
172
speak ("Sorray i am not send this mail" )
173
- == == == =
174
- master
175
- elif Q == "Take screenshot"
173
+ # =======
174
+ # master
175
+ elif Q == "Take screenshot" :
176
176
snapshot = ImageGrab .grab ()
177
- drive_letter = "C:\\ "
178
- folder_name = r'downloaded-files'
179
- folder_time = datetime .datetime .now ().strftime ("%Y-%m-%d_%I-%M-%S_%p" )
180
- extention = '.jpg'
181
- folder_to_save_files = drive_letter + folder_name + folder_time + extention
182
- snapshot .save (folder_to_save_files )
177
+ drive_letter = "C:\\ "
178
+ folder_name = r'downloaded-files'
179
+ folder_time = datetime .datetime .now ().strftime ("%Y-%m-%d_%I-%M-%S_%p" )
180
+ extention = '.jpg'
181
+ folder_to_save_files = drive_letter + folder_name + folder_time + extention
182
+ snapshot .save (folder_to_save_files )
183
183
184
184
elif Q == "Jokes" :
185
185
print (pyjokes .get_joke ())
186
186
187
- master
187
+ # master
188
188
else :
189
189
engine .say ("Sorry Try Again" )
190
190
engine .runAndWait ()
191
191
192
- == == == =
193
- == == == =
192
+ # =======
193
+ # =======
194
194
195
195
apps = {
196
196
"time" : datetime .now (),
@@ -202,17 +202,17 @@ def get_app(Q):
202
202
"cmd" : "cmd.exe" ,
203
203
"browser" : "C:\Program Files\Internet Explorer\iexplore.exe"
204
204
}
205
- master
205
+ # master
206
206
207
207
for app in apps :
208
208
if app == Q .lower ():
209
209
subprocess .call ([apps [app ]])
210
210
break
211
- master
211
+ # master
212
212
else :
213
213
engine .say ("Sorry Try Again" )
214
214
engine .runAndWait ()
215
- master
215
+ # master
216
216
return
217
217
# Call get_app(Query) Func.
218
218
Jarvis (Query ).get_app
0 commit comments