# DeviceList

属性：

* [is\_empty](/leapmotion_v2_cn/yu-yan/python/api-can-kao/leap.devicelist.md#is_empty)

方法：

* [append()](/leapmotion_v2_cn/yu-yan/python/api-can-kao/leap.devicelist.md#append)

## ***class*** **Leap.DeviceList**

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

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

*New in version 1.0.*

### 构造函数

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

*New in version 1.0.*

### 属性

#### is\_empty

类型：boolean

返回一个列表是否为空。

```python
if not controller.devices.is_empty:
    device = controller.devices[0]
```

*New in version 1.0.*

### 方法

#### append(*other*)

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

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

*New in version 1.0.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://changkun.gitbook.io/leapmotion_v2_cn/yu-yan/python/api-can-kao/leap.devicelist.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
