Packages

How to create a package

  • Organize .py files in a subdirectory structure
  • Include special __init__.py files.
     Graphics/
         __init__.py
         Primitives/
               __init__.py
               lines.py
               fill.py
               ...
         Plot2D/
               __init__.py
               xyplot.py
               logplot.py
               ...
         Formats/
               __init__.py
               png.py
               jpeg.py
               ...
<<< O'Reilly OSCON 2000, Introduction to Python, Slide 109
July 17, 2000, beazley@cs.uchicago.edu
>>>