Packages

Motivation

  • Sometimes it is useful to break an application into submodules
  • Example: A Graphics package
    • Graphics primitives
    • 2d plotting
    • 3d plotting
    • Image file formats

Packages can be used to create a hierarchical module namespace

     Graphics
     Graphics.Primitives
     Graphics.Primitives.lines
     Graphics.Plot2D.xyplot
     Graphics.Formats.png
     Graphics.Formats.jpeg
     ...
<<< O'Reilly OSCON 2000, Introduction to Python, Slide 108
July 17, 2000, beazley@cs.uchicago.edu
>>>