DeviceList

属性:

方法:

class Leap.DeviceList

DeviceList 继承自 Python 数组来表示一系列 Device 对象。

通过调用Controller.devices()来获得一个 DeviceList 对象。现在,这个列表只包含一个设备,无论你连了多少个设备到电脑上。

New in version 1.0.


构造函数

classmethod DeviceList() 构造一个设备的空列表。

New in version 1.0.


属性

is_empty

类型:boolean

返回一个列表是否为空。

  1. if not controller.devices.is_empty:
  2. device = controller.devices[0]

New in version 1.0.


方法

append(other)

添加一个指定的 DeviceList 成员到 DeviceList 中。

参数:other(DeviceList) - 一个 DeviceList 对象包含 Device 对象会添加到 DeviceList 的末尾。

New in version 1.0.