• Home
  • Raw
  • Download

Lines Matching +full:module +full:- +full:importer

1 :mod:`zipimport` --- Import modules from Zip archives
4 .. module:: zipimport
11 --------------
13 This module adds the ability to import Python modules (:file:`\*.py`,
14 :file:`\*.pyc`) and packages from ZIP-format archives. It is usually not
15 needed to use the :mod:`zipimport` module explicitly; it is automatically used
16 by the built-in :keyword:`import` mechanism for :data:`sys.path` items that are paths
19 Typically, :data:`sys.path` is a list of directory names as strings. This module
42 :pep:`273` - Import Modules from Zip Archives
47 :mod:`importlib` - The implementation of the import machinery
52 This module defines an exception:
60 .. _zipimporter-objects:
63 -------------------
85 .. method:: exec_module(module)
103 Search for a module specified by *fullname*. *fullname* must be the fully
104 qualified (dotted) module name. It returns the zipimporter instance itself
105 if the module was found, or :const:`None` if it wasn't. The optional
106 *path* argument is ignored---it's there for compatibility with the
107 importer protocol.
123 Return the code object for the specified module. Raise
124 :exc:`ZipImportError` if the module couldn't be imported.
138 Return the value ``__file__`` would be set to if the specified module
139 was imported. Raise :exc:`ZipImportError` if the module couldn't be
147 Return the source code for the specified module. Raise
148 :exc:`ZipImportError` if the module couldn't be found, return
149 :const:`None` if the archive does contain the module, but has no source
155 Return ``True`` if the module specified by *fullname* is a package. Raise
156 :exc:`ZipImportError` if the module couldn't be found.
161 Load the module specified by *fullname*. *fullname* must be the fully
162 qualified (dotted) module name. Returns the imported module on success,
180 The file name of the importer's associated ZIP file, without a possible
195 .. _zipimport-examples:
198 --------
200 Here is an example that imports a module from a ZIP archive - note that the
201 :mod:`zipimport` module is not explicitly used.
203 .. code-block:: shell-session
205 $ unzip -l example.zip
208 -------- ---- ---- ----
209 8467 11-26-02 22:30 jwzthreading.py
210 -------- -------