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
17
- == == == =
17
+ # =======
18
18
from playsound import * #for sound output
19
- master
19
+ # master
20
20
import speech_recognition as sr # speech_recognition Library for performing speech recognition with support for Google Speech Recognition, etc..
21
21
22
22
# pip install pyttsx3
@@ -63,7 +63,7 @@ def voice(p):
63
63
64
64
65
65
# Run Application with Voice Command Function
66
- only_jarvis
66
+ # only_jarvis
67
67
class Jarvis :
68
68
def __init__ (self , Q ):
69
69
self .query = Q
@@ -110,9 +110,9 @@ def get_app(self):
110
110
print (task )
111
111
return
112
112
113
- == == == =
113
+ # =======
114
114
def get_app (Q ):
115
- master
115
+ # master
116
116
if Q == "time" :
117
117
print (datetime .now ())
118
118
x = datetime .now ()
@@ -131,7 +131,7 @@ def get_app(Q):
131
131
subprocess .call (['cmd.exe' ])
132
132
elif Q == "browser" :
133
133
subprocess .call (['C:\Program Files\Internet Explorer\iexplore.exe' ])
134
- patch - 1
134
+ # patch-1
135
135
elif Q == "open youtube" :
136
136
webbrowser .open ("https://www.youtube.com/" ) # open youtube
137
137
elif Q == "open google" :
@@ -151,27 +151,27 @@ def get_app(Q):
151
151
except Exception as e :
152
152
print (e )
153
153
speak ("Sorray i am not send this mail" )
154
- == == == =
155
- master
156
- elif Q == "Take screenshot"
154
+ # =======
155
+ # master
156
+ elif Q == "Take screenshot" :
157
157
snapshot = ImageGrab .grab ()
158
- drive_letter = "C:\\ "
159
- folder_name = r'downloaded-files'
160
- folder_time = datetime .datetime .now ().strftime ("%Y-%m-%d_%I-%M-%S_%p" )
161
- extention = '.jpg'
162
- folder_to_save_files = drive_letter + folder_name + folder_time + extention
163
- snapshot .save (folder_to_save_files )
158
+ drive_letter = "C:\\ "
159
+ folder_name = r'downloaded-files'
160
+ folder_time = datetime .datetime .now ().strftime ("%Y-%m-%d_%I-%M-%S_%p" )
161
+ extention = '.jpg'
162
+ folder_to_save_files = drive_letter + folder_name + folder_time + extention
163
+ snapshot .save (folder_to_save_files )
164
164
165
165
elif Q == "Jokes" :
166
166
print (pyjokes .get_joke ())
167
167
168
- master
168
+ # master
169
169
else :
170
170
engine .say ("Sorry Try Again" )
171
171
engine .runAndWait ()
172
172
173
- == == == =
174
- == == == =
173
+ # =======
174
+ # =======
175
175
176
176
apps = {
177
177
"time" : datetime .now (),
@@ -183,17 +183,17 @@ def get_app(Q):
183
183
"cmd" : "cmd.exe" ,
184
184
"browser" : "C:\Program Files\Internet Explorer\iexplore.exe"
185
185
}
186
- master
186
+ # master
187
187
188
188
for app in apps :
189
189
if app == Q .lower ():
190
190
subprocess .call ([apps [app ]])
191
191
break
192
- master
192
+ # master
193
193
else :
194
194
engine .say ("Sorry Try Again" )
195
195
engine .runAndWait ()
196
- master
196
+ # master
197
197
return
198
198
# Call get_app(Query) Func.
199
199
Jarvis (Query ).get_app
0 commit comments