2013-10-24 26 views
0

基本上,我有以下:飞跃运动(Python)的 - 在我的代码错误或错误

if(controller.is_connected): 
     print "Connected.." 
    else: 
     print "Not connected.." 

如果设备被连接时,输出将被“连接”,然而,如果该设备是不连接,那么根本没有输出。这是我正在做的事情,还是API的问题?

+0

方案是否终止? – goncalopp

+0

执行此语句之前是否有代码行?也许您的声明只有在连接Leap Motion控制器时才能达到。 –

回答

-2

尝试过移动else块的缩进:

if(controller.is_connected): 
    print "Connected.." 
else: 
    print "Not connected.." 
+0

不,没有。这真是奇怪! – Phorce