1
1
2
- #coden for direct play of any music on youtube search anything on youtube and also for date time and email too
2
+ #code for direct play of any music on youtube search anything on youtube and also for date time and email too
3
3
4
4
import pyttsx3 #pip install pyttsx3
5
5
import speech_recognition as sr #pip install speechRecognition
@@ -117,21 +117,7 @@ def sendEmail(to, content):
117
117
# webbrowser.open(url, new = 1)
118
118
webbrowser .open_new (url )
119
119
120
-
121
- #query1 = takeCommand().lower()
122
- #search=browser.find_element_by_id('search')
123
- #search.send_keys(query1)
124
- #sbutton=browser.find_element_by_id('search-icon-legacy')
125
- # browser.find_elements_by_xpath()
126
- #sbutton.click()
127
- #video=browser.find_elements_by_partial_link_text('')
128
- #print(video)
129
- #speak('which number you want to listen')
130
- #print(video.__len__())
131
- #query2 = takeCommand().lower()
132
- #video[19].click()
133
- #if(query2=='1'):
134
- # video[0].click()
120
+
135
121
elif 'open google' in query :
136
122
webbrowser .open ("google.com" )
137
123
@@ -149,23 +135,17 @@ def sendEmail(to, content):
149
135
strTime = datetime .datetime .now ().strftime ("%H:%M:%S" )
150
136
speak (f"Sir, the time is { strTime } " )
151
137
152
- elif 'open code' in query :
153
- codePath = "C:\\ Users\\ Haris\\ AppData\\ Local\\ Programs\\ Microsoft VS Code\\ Code.exe"
154
- os .startfile (codePath )
155
-
156
- elif 'email to mohinesh' in query :
138
+ elif 'email to my friend' in query :
157
139
try :
158
140
speak ("What should I say?" )
159
141
content = takeCommand ()
160
-
142
+ speak ("to whom I have to sent the email" )
143
+ to = takeCommand ()
161
144
sendEmail (to , content )
162
145
speak ("Email has been sent!" )
163
146
except Exception as e :
164
147
print (e )
165
- speak ("Sorry my friend harry bhai. I am not able to send this email" )
166
-
167
- elif 'make me happy' in query :
168
- speak (" sarthak aayu, you are so beautiful" )
148
+ speak ("Sorry my friend. I am not able to send this email" )
169
149
170
150
171
151
elif 'play some music' in query :
0 commit comments