July 2009
Intermediate to advanced
744 pages
20h 2m
English
Large Python programs are organized into modules and packages. In addition, a large number of modules are included in the Python standard library. This chapter describes the module and package system in more detail. In addition, it provides information on how to install third-party modules and distribute source code.
import StatementAny Python source file can be used as a module. For example, consider the following code:

To load this code as a module, use the statement import spam. The first time import is used to load a module, it does three things:
1. It creates a new namespace that serves ...
Read now
Unlock full access