Update Jarvis2_4windows.py

This commit is contained in:
B.Jothin kumar 2021-10-08 12:32:05 +05:30 committed by GitHub
parent 935415f8f7
commit 1caf6f4804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,8 @@ import speech_recognition as sr
import wikipedia import wikipedia
from pygame import mixer from pygame import mixer
import gui
mixer.init() mixer.init()
print("Initializing Jarvis....") print("Initializing Jarvis....")
@ -45,6 +47,7 @@ def search(search_query, search_engine):
def speak(text): def speak(text):
gui.speak(text)
engine.say(text) engine.say(text)
engine.runAndWait() engine.runAndWait()
@ -90,7 +93,9 @@ def take_command():
speak("Initializing Jarvis....") speak("Initializing Jarvis....")
wish_me() wish_me()
while True:
def execute_the_command_said_by_user():
query = take_command() query = take_command()
# logic for executing basic tasks # logic for executing basic tasks
@ -172,3 +177,7 @@ while True:
mixer.music.unpause() mixer.music.unpause()
speak("Next Command! Sir!") speak("Next Command! Sir!")
gui.set_speak_command(execute_the_command_said_by_user)
gui.mainloop()