This code is about a virtual assistant which will aswer queries asked by the user. The program runs ok at first but it gets error after execution.
Also, how can I get output directly to a textbox?
def run(self):
self.task()
def task(self):
wish()
while True:
#main program logic and functions start here
print("Listening.....")
self.query = self.get_audio() #get_audio() is
print(self.query)
if "hello" in self.query:
speak("Hello, I am mirror. I can check your schedule, search wikipedia, write notes, tell news and can tell you a joke")
CALENDAR_STRS = ["do i have", "i have", "busy", "plans on", "plan on",]
for phrase in CALENDAR_STRS:
if phrase in self.query:
date = self.get_date(self.query)
if date:
self.get_events(date)
speak("you have following upcoming events")
break
else:
speak("I don't understand. can you please repeat")
break