December 2000
Intermediate to advanced
816 pages
16h 57m
English
A package is a hierarchical file directory structure that defines a single Python application environment that consists of modules and subpackages. Packages were added to Python 1.5 to aid with a variety of problems including:
Adding hierarchical organization to flat namespace
Allowing developers to group-related modules
Allowing distributors to ship directories vs. bunch of files
Helping resolve conflicting module names
Along with classes and modules, packages use the familiar attribute/dotted attribute notation to access their elements. Importing modules within packages use the standard import and from-import statements.
The example package directory structure below is available for you to experiment ...
Read now
Unlock full access