Correctness: sys.path.append("..")

Mark McEahern marklists at mceahern.com
Tue Jan 8 21:56:31 EST 2002


Jeremy Bowers wrote:
> I have modules in biz that want, nay, need to use modules in presentation.

  /myproj/biz/customer.py
  /myproj/presentation/layout.py
  /myproj/data/tabular.py

If the parent of myproj is in PYTHONPATH, your problem is solved with my
approach.

I think my solution requires you to put __init__.py in the various
directories.  You can simply have it say:

pass

Further, if you use distutils to distribute your app, it will install to a
location that is already in the path.  Problem solved.

// mark





More information about the Python-list mailing list