Mon code python google search ne fonctionne pas
Dorian
-
noplou -
noplou -
Bonjour,
J'ai écrit un code python qui me sert a faire des recherches google, mais quand me programme me dit de dire ma recherche, la recherche ne se lance pas.
Quelqu'un pourrez m'aider s'il vous plaît ?
def recherche():
talk("Que voulez-vous rechercher ?")
engine.runAndWait()
with sr.Microphone() as source:
print("Dites votre recherche")
voice = listener.listen(source)
command = listener.recognize_google(voice, language="fr-FR")
command = command.lower()
print(command)
if "opale" in command:
command = command.replace("opale", "")
print(command)
mySearch = input()
webbrowser.open("https://www.google.com/search?q=" + mySearch)
1 réponse
-
yg_be Messages postés 23437 Date d'inscription Statut Contributeur Dernière intervention Ambassadeur 1 588
bonjour,
es-tu certain de nous avoir montré tout ton code?
-
oui je l'ai joint avec, je le remet ci-dessous :
def recherche(): with sr.Microphone() as source: print("Dites votre recherche") voice = listener.listen(source) command = listener.recognize_google(voice, language="fr-FR") command = command.lower() print(command) if "opale" in command or "recherche pour moi" in command: command = command.replace("opale", "") print(command) mySearch = input() webbrowser.open("https://www.google.com/search?q=" + mySearch) return command
-