# Python 集成工具

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/idea/llms.txt).

> **TL;DR**
> `文件 | 设置 | 工具 | Python 集成工具`  适用于 Windows 和 Linux
>
>
>
> `%instance% | 设置 | 工具 | Python 集成工具`  适用于 macOS
>
>
>
> `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.settings.svg)

> **Warning:**
> 以下内容仅当已 [安装并启用](managing-plugins.html)Python 和 Python Community Edition 插件时有效！

使用本页配置需求管理文件、默认测试运行程序和文档字符串处理。

|  条目  |  描述  |
| --- | --- |
|  软件包要求文件  |  请输入 [requirements 文件](null) 的名称，或点击浏览按钮，并使用 [Select Path](null) 对话框从文件系统中选择所需的 requirements 文件。  |
|  默认测试运行程序  |  选择每次在测试用例的上下文菜单中选择  `运行`  时，IntelliJ IDEA 将建议的测试运行/调试配置。    可能的选项包括：        * unittest 测试    * pytest    * nose 测试    * Twisted Trial 测试    |
|  检测 Jupyter Notebook 中的测试  |  如果要将 Jupyter Notebook 文件包含在单元测试检测的作用域内，请选中此复选框。  |
|  文档字符串格式  |  请选择 IntelliJ IDEA 要识别的文档字符串格式。    根据所选的 docstring 格式，IntelliJ IDEA 将生成存根文档注释，并在 [显示快速文档](viewing-reference-information.html#inline-quick-documentation)中呈现文本：        * 普通 ：在按下 `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS))或空格后打开引号后，会生成一个空stub；快速文档显示为普通文本。    * reStructuredText ：按下 `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)) 或空格后，打开引号后会根据 [reStructuredText](http://docutils.sourceforge.net/rst.html) 格式生成存根文档注释；快速文档由 Docutils 渲染。    * NumPy ：按下 `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS))或空格后添加引号时，将按照 [NumPy](http://sphinxcontrib-napoleon.readthedocs.org/en/latest/example_numpy.html)格式生成存根文档注释；快速文档由 [Napoleon](https://sphinxcontrib-napoleon.readthedocs.org/en/latest/)和Docutils渲染。    * Google ：按下 `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS))或空格键后，在开引号之后会生成符合 [Google](http://sphinxcontrib-napoleon.readthedocs.org/en/latest/example_google.html)格式的文档注释存根；快速文档由 [Napoleon](https://sphinxcontrib-napoleon.readthedocs.org/en/latest/)和 Docutils 渲染。      各种类型的文档字符串功能：        * 正确生成 docstrings    * 应用意图操作和快速修复后的更新    * 编码辅助    * 章节标题自动补全     > **Note:** > 文档字符串中提供的信息用于代码洞察。    |
|  分析文档字符串中的 Python 代码  |     如果选中此复选框，IntelliJ IDEA 会高亮代码示例并进行语法检查和代码检查。       如果此复选框未选中，docstrings 内的代码片段将不被分析。     |
|  为  `stdlib`  渲染外部文档。  |  启用显示来自 [http://docs.python.org](http://docs.python.org)中  `查看 \| 快速文档` 的标准库函数文档。  |
|  Sphinx 工作目录  |     指定包含  `.rst`  文件和  `conf.py`  配置的目录路径。 IntelliJ IDEA 使用它来识别自定义角色，并为 Sphinx 文档提供准确的高亮显示和渲染。     |
|  将  `.txt`  文件视为 reStructuredText  |  如果选中此复选框，则具有  `.txt`  扩展名的文件将与具有  `.rst`  扩展名的文件以相同方式高亮显示。  |

## See also

### 参考

[智能按键](settings-smart-keys.html) [运行/调试配置对话框](run-debug-configurations-dialog.html)

### 外部链接

[Python docstrings](http://www.python.org/dev/peps/pep-0257/) [Sphinx](https://www.sphinx-doc.org/en/master/index.html) [epydoc](http://epydoc.sourceforge.net/) [reStructuredText](http://docutils.sourceforge.net/rst.html) [Google](http://sphinxcontrib-napoleon.readthedocs.org/en/latest/example_google.html) [NumPy](http://sphinxcontrib-napoleon.readthedocs.org/en/latest/example_numpy.html) [Napoleon](https://sphinxcontrib-napoleon.readthedocs.org/en/latest/) [Defining custom roles in Sphinx](http://www.doughellmann.com/articles/how-tos/sphinx-custom-roles/index.html)

