Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我可以使用Alexa技能作为退出while循环的条件吗?_Python_Python 3.x_Alexa_Flask Ask - Fatal编程技术网

Python 我可以使用Alexa技能作为退出while循环的条件吗?

Python 我可以使用Alexa技能作为退出while循环的条件吗?,python,python-3.x,alexa,flask-ask,Python,Python 3.x,Alexa,Flask Ask,我试图建立一个设备,保持多个电机在默认模式下运行,除非用户指示Alexa使其移动。伪代码如下所示: intentInvoked = checkIfIntentInvoked() while intentInvoked not True: intentInvoked = checkIfIntentInvoked() #motors run in default mode 我想知道是否有办法实现checkifitentinvoked()函数。我已经阅读了文档,它说只要用

我试图建立一个设备,保持多个电机在默认模式下运行,除非用户指示Alexa使其移动。伪代码如下所示:

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

我想知道是否有办法实现checkifitentinvoked()函数。我已经阅读了文档,它说只要用户触发意图调用,它就会自动映射到用Python编程的意图(我使用的是flaskask)

您可以通过web访问(例如通过api)将应用程序的状态存储在某些存储器中

然后,当您调用意图时,只需编写更改应用程序状态的代码


在负责电机旋转的应用程序中,只需阅读应用程序状态,而不是检查意图是否已被调用。

我不明白您的问题。此代码是在设备上运行还是在技能中运行?