Home » Python » python – Can I use an Alexa skill as a condition to exit a while loop?-Exceptionshub

python – Can I use an Alexa skill as a condition to exit a while loop?-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:

I am trying to build a device that keeps multiple motors running in default mode unless a user instructs Alexa to make them move otherwise. The pseudocode looks something like this:

intentInvoked = checkIfIntentInvoked()
while intentInvoked not True:
     intentInvoked = checkIfIntentInvoked()    
     #motors run in default mode

I want to know if there’s a way to implement the checkIfIntentInvoked() function. I have read the documentation and it pretty much says that as long as the user triggers the intent invocation, it automatically maps to the intent programmed in Python (I am using flask-ask).

How to&Answers: