Chapter 19. Modules and Packages
Python’s primary extension mechanism uses source code saved to modules and incorporated into a program through the import
statement. The features that most developers think of as “Python” are actually implemented as the collection of modules called the Standard Library, the subject of this book. Although the import feature is built into the interpreter itself, the library also includes several modules related to the import process.
The importlib
(page 1329) module exposes the underlying implementation of the import mechanism used by the interpreter. It can be used to import modules dynamically at runtime, instead of using the import
statement to load them during start-up. Dynamically loading modules is useful ...
Get The Python 3 Standard Library by Example, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.