On Wed, 31 Aug 2005 15:07:41 +0200
Peter Maas <[EMAIL PROTECTED]> wrote:
> I want a tree
> 
> top/
>      install.py
>      sub1/
>          __init__.py
>          mod1.py
>      sub2/
>          mod2.py
> 
> where I can do "from sub1 import mod1" in mod2.py no matter what the
> absolute path of top is. To achieve this I start install.py once to
> retrieve the absolute dir of itself (= abspath of top/) and creates
> .pth files with its absolute dir in every subdirectory.

If top/ is the working directory for your Python interpreter, the
problem is solved automatically. Python puts the current working
directory in the default search path. So, if you run

python sub2/mod2.py

then it would work.

HTH,
-Michael
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to