sphinx 在当前类中显示父类的属性和接口
时间: 2023-02-16 10:07:31 浏览: 56
Sphinx 是一个用于生成文档的工具。在 Sphinx 中,可以使用 `:inherited-members:` 选项来显示父类的属性和接口。在 Sphinx 的配置文件中,可以在某个类的定义中添加 `:inherited-members:` 选项,来显示该类继承的所有属性和接口。
例如:
```
.. class:: MyClass
:inherited-members:
```
这将在文档中显示 MyClass 类继承的所有属性和接口。
相关问题
如何在python中安装pocketsphinx
你可以通过以下步骤在 Python 中安装 Pocketsphinx:
1. 首先,安装 Pocketsphinx 的依赖项。在 Ubuntu 系统中,可以使用以下命令安装:
```
sudo apt-get install python python-dev python-pip build-essential swig git libpulse-dev
```
2. 接下来,安装 Pocketsphinx。可以使用以下命令从 PyPI 安装:
```
pip install pocketsphinx
```
或者,从 GitHub 上克隆 Pocketsphinx 代码并安装:
```
git clone https://github.com/cmusphinx/pocketsphinx-python.git
cd pocketsphinx-python
python setup.py install
```
3. 安装完毕后,可以在 Python 中导入 Pocketsphinx:
```
import pocketsphinx
```
如果没有报错,则说明安装成功。
提示:Pocketsphinx 是一个 C 语言实现的库,Python 中的 pocketsphinx 模块实际上是通过 ctypes 库调用 C 库实现的。因此,在安装 Pocketsphinx 时,需要确保系统中已经安装了 C 语言编译器和必要的开发库。
如何在python中安装sudo pip install pocketsphinx
在安装 pocketsphinx 之前,你需要先安装 Sphinxbase 和 PocketSphinx 的依赖库。可以使用以下命令安装:
```
sudo apt-get install python python-dev python-pip build-essential swig git libpulse-dev
```
然后,使用以下命令安装 Sphinxbase 和 PocketSphinx:
```
sudo pip install sphinxbase
sudo pip install pocketsphinx
```
注意:如果你使用的是 Windows 操作系统,需要从官网下载预编译的 wheels 文件进行安装。
相关推荐
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)