i solve the problem this way but there must be a way not to repeat all the code so many times:
if "pomme" in text: tts = gTTS(u"le fruit a été ajouté dans le panier", lang="fr") tts.save('out.mp3') cmd = ['mpg321', '-q', 'out.mp3'] subprocess.call(cmd) if "fraise" in text: tts = gTTS(u"le fruit a été ajouté dans le panier", lang="fr") tts.save('out.mp3') cmd = ['mpg321', '-q', 'out.mp3'] subprocess.call(cmd) ...I thought the h in hotword was looping everyword in the list and if h == text (so "pomme" in list = the word text when = "pomme" than it excute the script?