.pth - howto?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • flippetigibbet

    #1

    .pth - howto?

    I was thinking that if I create:
    \documents and settings\user\M y
    Documents\my\sc ripts\py\dirnam e\__init__.py
    and a .pth file in site-packages with something like:
    \documents and settings\user\M y Documents\my\sc ripts\py\dirnam e
    then my script __init__.py should run when I import dirname
    but it doesn't

    My team of trigger-happy lawyers is currently analyzing "Installing
    Python Modules", which says:
    Paths can be absolute or relative, in which case they're relative to
    the directory containing the .pth file.

    I've tried specifying the .pth file with
    r'\documents and settings\user\M y Documents\my\sc ripts\py\dirnam e'
    \DOCUME~1\user\ MyDocu~1\my\scr ipts\py\dirname
    /doceme~1/user/MYDOCU~1/MY/SCRIPTS/PY/DIRNAME
    but I can't seem to get python 2.4 to pick up an absolute path on
    windows.

    I know I could put my scripts in site-packages, but I quite like the
    idea of keeping my scripts and 3rd party scripts separate. Also, I
    would prefer not to add "\documents and settings\user\M y
    Documents\my\sc ripts\py" to the PYTHONPATH, because as soon as I
    install some 3rd party, I tend to write a 'play' script to run it, so I
    only want the stuff I specify on the path.

    So how do I configure an absolute path in a .pth file on windows?

Working...