语音助手没有被终止
Voice assistant not getting terminated
你好,我目前正在制作语音助手,我想终止它,但它没有终止,只是重复
elif 'you can sleep now' in query or 'take rest' in query:
speak('ohk master I am going to sleep you can call me again anytime going to sleep in 3 ,2 , 1')
break
if __name__ == "__main__":
while True:
permission = takeCommand()
if 'wake up' in permission:
task_execute()
elif 'close' in permission or 'buy' in permission:
speak('ok sir have a good day')
exit()
在 speak()
之后添加 break
以跳出循环。
你好,我目前正在制作语音助手,我想终止它,但它没有终止,只是重复
elif 'you can sleep now' in query or 'take rest' in query:
speak('ohk master I am going to sleep you can call me again anytime going to sleep in 3 ,2 , 1')
break
if __name__ == "__main__":
while True:
permission = takeCommand()
if 'wake up' in permission:
task_execute()
elif 'close' in permission or 'buy' in permission:
speak('ok sir have a good day')
exit()
在 speak()
之后添加 break
以跳出循环。