Organising packages/modules - importing functions from a common.py in a separate directory?

Peter Otten __peter__ at web.de
Wed Oct 30 06:23:34 EDT 2013


Victor Hooi wrote:

> Wait - err, subpackage != module, right? Do you think you could explain
> what a sub-package is please? I tried Googling, and couldn't seem to find
> the term in this context.

[second attempt]

In analogy to the term "subdirectory" em_load and pg_load -- and common if 
you add an __init__.py -- would be sub-packages, provided only the parent of 
foo_loading is in sys.path and you import them with

import foo_loading.pg_load

etc.





More information about the Python-list mailing list