Package organization: where to put 'common' modules?

Kent Johnson kent at kentsjohnson.com
Sun Mar 5 20:59:36 EST 2006


Paul Boddie wrote:
> Yes, Python does this - it puts the directory of bar.py (B in this
> case) in sys.path, but not the directory in which you're sitting when
> you run the program from the shell (A in this case).

This seems to be OS dependent. If I put 'print sys.path' at the start of 
site.py (which does most of the setup of sys.path), one element of the 
path is an empty string. This is expanded by
main() -> removeduppaths() -> makepath() -> os.path.abspath()
to the current working dir.

This is Python 2.4.2 on Win2K.

Kent



More information about the Python-list mailing list