导航

  • 索引
  • 模块 |
  • 下一页 |
  • 上一页 |
  • Python »
  • 3.6.15 Documentation »
  • Python 标准库 »
  • |

31. 导入模块¶

本章中介绍的模块提供了导入其他Python模块和挂钩以自定义导入过程的新方法。

本章描述的完整模块列表如下:

  • 31.1. zipimport — 从 Zip 存档中导入模块
    • 31.1.1. zipimporter 对象
    • 31.1.2. 例子
  • 31.2. pkgutil — 包扩展模块工具
  • 31.3. modulefinder — 查找脚本使用的模块
    • 31.3.1. ModuleFinder 的示例用法
  • 31.4. runpy — Locating and executing Python modules
  • 31.5. importlib — The implementation of import
    • 31.5.1. 概述
    • 31.5.2. 函数
    • 31.5.3. importlib.abc —— 关于导入的抽象基类
    • 31.5.4. importlib.machinery – Importers and path hooks
    • 31.5.5. importlib.util – Utility code for importers
    • 31.5.6. 例子
      • 31.5.6.1. Importing programmatically
      • 31.5.6.2. Checking if a module can be imported
      • 31.5.6.3. Importing a source file directly
      • 31.5.6.4. Setting up an importer
      • 31.5.6.5. Approximating importlib.import_module()

上一个主题

30.2. codeop — 编译Python代码

下一个主题

31.1. zipimport — 从 Zip 存档中导入模块

本页

  • 提交 Bug
  • 显示源代码

导航

  • 索引
  • 模块 |
  • 下一页 |
  • 上一页 |
  • Python »
  • 3.6.15 Documentation »
  • Python 标准库 »
  • |
© 版权所有 2001-2021, Python Software Foundation.
Python 软件基金会是一个非盈利组织。 请捐助。
最后更新于 9月 05, 2021. 发现了问题?
使用Sphinx2.3.1 创建。