Python logo

上個主題

codeop --- 編譯 Python 程式碼

下個主題

zipimport --- 從 Zip 封存檔案匯入模組

此頁面

  • 回報錯誤
  • 顯示原始碼

瀏覽

  • 索引
  • 模組 |
  • 下一頁 |
  • 上一頁 |
  • Python logo
  • Python »
  • 3.12.10 Documentation »
  • Python 標準函式庫 (Standard Library) »
  • 引入模組
  • |
  • |

引入模組¶

The modules described in this chapter provide new ways to import other Python modules and hooks for customizing the import process.

The full list of modules described in this chapter is:

  • zipimport --- 從 Zip 封存檔案匯入模組
    • zipimporter 物件
    • 範例
  • pkgutil --- 套件擴充工具程式
  • modulefinder --- 搜尋腳本所使用的模組
    • ModuleFinder 的用法範例
  • runpy --- 定位並執行 Python 模組
  • importlib --- import 的實作
    • 簡介
    • 函式
    • importlib.abc -- Abstract base classes related to import
    • importlib.machinery -- Importers and path hooks
    • importlib.util -- Utility code for importers
    • 範例
      • Importing programmatically
      • Checking if a module can be imported
      • Importing a source file directly
      • Implementing lazy imports
      • Setting up an importer
      • Approximating importlib.import_module()
  • importlib.resources -- Package resource reading, opening and access
    • Functional API
  • importlib.resources.abc -- 資源的抽象基底類別
  • importlib.metadata -- 存取套件的元資料
    • Overview
    • Functional API
      • Entry points
      • Distribution metadata
      • Distribution versions
      • Distribution files
      • Distribution requirements
      • Mapping import to distribution packages
    • Distributions
    • Distribution Discovery
    • Extending the search algorithm
  • The initialization of the sys.path module search path
    • Virtual environments
    • _pth files
    • Embedded Python

上個主題

codeop --- 編譯 Python 程式碼

下個主題

zipimport --- 從 Zip 封存檔案匯入模組

此頁面

  • 回報錯誤
  • 顯示原始碼
«

瀏覽

  • 索引
  • 模組 |
  • 下一頁 |
  • 上一頁 |
  • Python logo
  • Python »
  • 3.12.10 Documentation »
  • Python 標準函式庫 (Standard Library) »
  • 引入模組
  • |
  • |
© 版權 2001-2025, Python Software Foundation.
This page is licensed under the Python Software Foundation License Version 2.
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
See History and License for more information.

The Python Software Foundation is a non-profit corporation. Please donate.

最後更新於 4月 11, 2025 (20:55 UTC)。 Found a bug?
使用 Sphinx 8.2.3 建立。