Developpez.com

Python

Choisissez la catégorie, puis la rubrique :

29.2.1 zipimporter Objects


29.2.1 zipimporter Objects

class zipimporter( archivepath)
Create a new zipimporter instance. archivepath must be a path to a zipfile. ZipImportError is raised if archivepath doesn't point to a valid ZIP archive.

find_module( fullname[, path])
Search for a module specified by fullname. fullname must be the fully qualified (dotted) module name. It returns the zipimporter instance itself if the module was found, or None if it wasn't. The optional path argument is ignored--it's there for compatibility with the importer protocol.

get_code( fullname)
Return the code object for the specified module. Raise ZipImportError if the module couldn't be found.

get_data( pathname)
Return the data associated with pathname. Raise IOError if the file wasn't found.

get_source( fullname)
Return the source code for the specified module. Raise ZipImportError if the module couldn't be found, return None if the archive does contain the module, but has no source for it.

is_package( fullname)
Return True if the module specified by fullname is a package. Raise ZipImportError if the module couldn't be found.

load_module( fullname)
Load the module specified by fullname. fullname must be the fully qualified (dotted) module name. It returns the imported module, or raises ZipImportError if it wasn't found.

See About this document... for information on suggesting changes.
Contacter le responsable de la rubrique Python

Partenaire : Hébergement Web