24
24
25
25
# importing the pyttsx3 library
26
26
import pyttsx3
27
+ import webbrowser
27
28
28
29
# initialisation
29
30
engine = pyttsx3 .init ()
30
31
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
+
31
42
# obtain audio from the microphone
32
43
r = sr .Recognizer ()
33
44
with sr .Microphone () as source :
@@ -68,6 +79,27 @@ def get_app(Q):
68
79
subprocess .call (['cmd.exe' ])
69
80
elif Q == "browser" :
70
81
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
+ == == == =
71
103
master
72
104
elif Q == "Take screenshot"
73
105
snapshot = ImageGrab .grab ()
@@ -81,6 +113,7 @@ def get_app(Q):
81
113
elif Q == "Jokes" :
82
114
print (pyjokes .get_joke ())
83
115
116
+ master
84
117
else :
85
118
engine .say ("Sorry Try Again" )
86
119
engine .runAndWait ()
0 commit comments