Skip to content

Commit 303069d

Browse files
Merge pull request #926 from Arjunvankani/patch-1
Added Email,google and YouTube option to implement
2 parents 0e0666e + b4a4af7 commit 303069d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

JARVIS/JARVIS.py

+33
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,21 @@
2424

2525
# importing the pyttsx3 library
2626
import pyttsx3
27+
import webbrowser
2728

2829
# initialisation
2930
engine = pyttsx3.init()
3031

32+
33+
def sendEmail(do, content):
34+
server = smtplib.SMTP('smtp.gmail.com', 587)
35+
server.ehlo()
36+
server.starttls()
37+
server.login('[email protected]', 'yourr-password-here')
38+
server.sendmail('[email protected]', to, content)
39+
server.close()
40+
41+
3142
# obtain audio from the microphone
3243
r = sr.Recognizer()
3344
with sr.Microphone() as source:
@@ -68,6 +79,27 @@ def get_app(Q):
6879
subprocess.call(['cmd.exe'])
6980
elif Q == "browser":
7081
subprocess.call(['C:\Program Files\Internet Explorer\iexplore.exe'])
82+
patch-1
83+
elif Q == "open youtube":
84+
webbrowser.open("https://www.youtube.com/") # open youtube
85+
elif Q == "open google":
86+
webbrowser.open("https://www.google.com") # open google
87+
88+
elif Q == "email to other": # here you want to change and input your mail and password whenver you implement
89+
try:
90+
speak("What should I say?")
91+
r = sr.Recognizer()
92+
with sr.Microphone() as source:
93+
print("Listening...")
94+
r.pause_threshold = 1
95+
audio = r.listen(source)
96+
97+
sendEmail(to, content)
98+
speak("Email has been sent!")
99+
except Exception as e:
100+
print(e)
101+
speak("Sorray i am not send this mail")
102+
=======
71103
master
72104
elif Q=="Take screenshot"
73105
snapshot=ImageGrab.grab()
@@ -81,6 +113,7 @@ def get_app(Q):
81113
elif Q=="Jokes":
82114
print(pyjokes.get_joke())
83115

116+
master
84117
else:
85118
engine.say("Sorry Try Again")
86119
engine.runAndWait()

0 commit comments

Comments
 (0)