“Python/docs/3.9/library/language”的版本间差异
来自菜鸟教程
Python/docs/3.9/library/language
(autoload) |
小 (Page commit) |
||
第1行: | 第1行: | ||
+ | {{DISPLAYTITLE:Python 语言服务 — Python 文档}} | ||
<div id="python-language-services" class="section"> | <div id="python-language-services" class="section"> | ||
<span id="language"></span> | <span id="language"></span> | ||
− | = Python | + | = Python 语言服务 = |
− | Python | + | Python 提供了许多模块来帮助使用 Python 语言。 这些模块支持标记化、解析、语法分析、字节码反汇编和各种其他功能。 |
− | |||
− | |||
− | + | 这些模块包括: | |
<div class="toctree-wrapper compound"> | <div class="toctree-wrapper compound"> | ||
− | * [[../parser|<code>parser</code> | + | * [[../parser|<code>parser</code> — 访问 Python 解析树]] |
− | ** [[../parser#creating-st-objects| | + | ** [[../parser#creating-st-objects|创建 ST 对象]] |
− | ** [[../parser#converting-st-objects| | + | ** [[../parser#converting-st-objects|转换 ST 对象]] |
− | ** [[../parser#queries-on-st-objects| | + | ** [[../parser#queries-on-st-objects|ST 对象查询]] |
− | ** [[../parser#exceptions-and-error-handling| | + | ** [[../parser#exceptions-and-error-handling|异常和错误处理]] |
− | ** [[../parser#st-objects| | + | ** [[../parser#st-objects|ST对象]] |
− | ** [[parser | + | ** [[../parser#example-emulation-of-compile|示例:<code>compile()</code> 的仿真]] |
− | * [[../ast|<code>ast</code> | + | * [[../ast|<code>ast</code> — 抽象语法树]] |
− | ** [[../ast#abstract-grammar| | + | ** [[../ast#abstract-grammar|抽象语法]] |
− | ** [[../ast#node-classes| | + | ** [[../ast#node-classes|节点类]] |
− | *** [[../ast#literals| | + | *** [[../ast#literals|文字]] |
− | *** [[../ast#variables| | + | *** [[../ast#variables|变量]] |
− | *** [[../ast#expressions| | + | *** [[../ast#expressions|表达式]] |
− | **** [[../ast#subscripting| | + | **** [[../ast#subscripting|下标]] |
− | **** [[../ast#comprehensions| | + | **** [[../ast#comprehensions|领悟]] |
− | *** [[../ast#statements| | + | *** [[../ast#statements|声明]] |
− | **** [[../ast#imports| | + | **** [[../ast#imports|进口]] |
− | *** [[../ast#control-flow| | + | *** [[../ast#control-flow|控制流]] |
− | *** [[../ast#function-and-class-definitions| | + | *** [[../ast#function-and-class-definitions|函数和类定义]] |
− | *** [[../ast#async-and-await| | + | *** [[../ast#async-and-await|异步和等待]] |
− | ** [[../ast#ast-helpers|<code>ast</code> | + | ** [[../ast#ast-helpers|<code>ast</code> 帮手]] |
− | ** [[../ast#compiler-flags| | + | ** [[../ast#compiler-flags|编译器标志]] |
− | ** [[../ast#command-line-usage| | + | ** [[../ast#command-line-usage|命令行使用]] |
− | * [[../symtable|<code>symtable</code> | + | * [[../symtable|<code>symtable</code> — 访问编译器的符号表]] |
− | ** [[../symtable#generating-symbol-tables| | + | ** [[../symtable#generating-symbol-tables|生成符号表]] |
− | ** [[../symtable#examining-symbol-tables| | + | ** [[../symtable#examining-symbol-tables|检查符号表]] |
− | * [[../symbol|<code>symbol</code> | + | * [[../symbol|<code>symbol</code> — 与 Python 解析树一起使用的常量]] |
− | * [[../token|<code>token</code> | + | * [[../token|<code>token</code> — 与 Python 解析树一起使用的常量]] |
− | * [[../keyword|<code>keyword</code> | + | * [[../keyword|<code>keyword</code> — 测试 Python 关键字]] |
− | * [[../tokenize|<code>tokenize</code> | + | * [[../tokenize|<code>tokenize</code> — Python 源代码的分词器]] |
− | ** [[../tokenize#tokenizing-input| | + | ** [[../tokenize#tokenizing-input|标记输入]] |
− | ** [[../tokenize#command-line-usage| | + | ** [[../tokenize#command-line-usage|命令行使用]] |
− | ** [[../tokenize#examples| | + | ** [[../tokenize#examples|例子]] |
− | * [[../tabnanny|<code>tabnanny</code> | + | * [[../tabnanny|<code>tabnanny</code> — 模糊压痕检测]] |
− | * [[../pyclbr|<code>pyclbr</code> | + | * [[../pyclbr|<code>pyclbr</code> — Python 模块浏览器支持]] |
− | ** [[../pyclbr#function-objects| | + | ** [[../pyclbr#function-objects|函数对象]] |
− | ** [[../pyclbr#class-objects| | + | ** [[../pyclbr#class-objects|类对象]] |
− | * [[../py_compile|<code>py_compile</code> | + | * [[../py_compile|<code>py_compile</code> — 编译 Python 源文件]] |
− | * [[../compileall|<code>compileall</code> | + | * [[../compileall|<code>compileall</code> — 字节编译 Python 库]] |
− | ** [[../compileall#command-line-use| | + | ** [[../compileall#command-line-use|命令行使用]] |
− | ** [[../compileall#public-functions| | + | ** [[../compileall#public-functions|公共职能]] |
− | * [[../dis|<code>dis</code> | + | * [[../dis|<code>dis</code> — Python 字节码的反汇编器]] |
− | ** [[../dis#bytecode-analysis| | + | ** [[../dis#bytecode-analysis|字节码分析]] |
− | ** [[../dis#analysis-functions| | + | ** [[../dis#analysis-functions|分析功能]] |
− | ** [[../dis#python-bytecode-instructions|Python | + | ** [[../dis#python-bytecode-instructions|Python 字节码说明]] |
− | ** [[../dis#opcode-collections| | + | ** [[../dis#opcode-collections|操作码集合]] |
− | * [[../pickletools|<code>pickletools</code> | + | * [[../pickletools|<code>pickletools</code> — pickle 开发人员的工具]] |
− | ** [[../pickletools#command-line-usage| | + | ** [[../pickletools#command-line-usage|命令行使用]] |
− | *** [[../pickletools#command-line-options| | + | *** [[../pickletools#command-line-options|命令行选项]] |
− | ** [[../pickletools#programmatic-interface| | + | ** [[../pickletools#programmatic-interface|编程接口]] |
第67行: | 第66行: | ||
</div> | </div> | ||
+ | <div class="clearer"> | ||
− | [[Category:Python 3.9 | + | |
+ | |||
+ | </div> | ||
+ | |||
+ | [[Category:Python 3.9 文档]] |
2021年10月31日 (日) 04:52的最新版本
Python 语言服务
Python 提供了许多模块来帮助使用 Python 语言。 这些模块支持标记化、解析、语法分析、字节码反汇编和各种其他功能。
这些模块包括:
parser
— 访问 Python 解析树ast
— 抽象语法树symtable
— 访问编译器的符号表symbol
— 与 Python 解析树一起使用的常量token
— 与 Python 解析树一起使用的常量keyword
— 测试 Python 关键字tokenize
— Python 源代码的分词器tabnanny
— 模糊压痕检测pyclbr
— Python 模块浏览器支持py_compile
— 编译 Python 源文件compileall
— 字节编译 Python 库dis
— Python 字节码的反汇编器pickletools
— pickle 开发人员的工具