Re: .pth files in working directory



Peter Hansen schrieb:
Not sure from the above description exactly what it is you want,

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.

> but
generally such non-standard sys.path and .pth manipulations are best handled by a sitecustomize.py file, possibly which makes its own calls to site.addsitedir() and such. Try "help(site)" for more.

But sitecustomize.py changes the Python installation, doesn't it? This wouldn't be an advantage over putting a .pth file into ..../site-packages.

--
-------------------------------------------------------------------
Peter Maas,  M+R Infosysteme,  D-52070 Aachen,  Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------
.



Relevant Pages

  • Re: Determine if path is absolute or relative
    ... even a simple file name could be called an absolute path.] ... It was you having a Q, Anthony, not me. ... size of the universe you are working in. ... Web Application I would call the path /mydir/subir/ an absolute path ...
    (microsoft.public.scripting.jscript)
  • Re: require_once() ... gone mad? !
    ... I am passing the fully qualified (i.e. absolute pathname) to a file that exists on my machine. ... I suspect you're missing the 'www' part in the absolute path. ... Now temporarily looking for some smaller PHP/MySQL projects/work to fund a self developed bigger project, mail me at rik at rwasmus.nl. ...
    (comp.lang.php)
  • hyperlinks - absolute path refuses to stay!!!!
    ... disk and run it off the disk, meaning any relative paths will not ... an absolute path into a hyperlink in excel is to manually go and look ... I know you can set a 'hyperlink base address' for all hyperlinks in the ...
    (microsoft.public.excel.misc)
  • Re: .pth files in working directory
    ... > absolute path of top is. ... If top/ is the working directory for your Python interpreter, ...
    (comp.lang.python)
  • Re: Saving Absolute Hyperlinks
    ... The terms absolute and relative ... hyperlinks were new to me although I use these forms ... Microsoft MVP - Excel ... > Could you please indicate me how to conserve the absolute path? ...
    (microsoft.public.excel.programming)