I need help to construct a working while loop. my code goes like this
class Bot():
def __init__(self):
self.woke = False
while self.woke == False:
self.wake_word() # --> when it predicts wake word self.woke changes to True
while self.woke == True:
self.voice_recognition() # --> takes audio turns it to a spoke.txt file
break
self.chat() # --> reads the spoke.txt and finds a response
self.respond() # --> speaks the responds using pyttsx3
the code works perfectly but only for one time..it does what I want it to do but for once and then the script stops. I need to run it until I give the command to stop it using
sys.exit(0) # in a function
meaning when it responses it starts listening again (self.voice_recognition() function) and again does the chat() and finds a respond().