Refined: How do I launch 'somewhere/Sweety.py' without 'somewhere/'?

Martin Bless m.bless at gmx.de
Sun Apr 8 07:12:30 EDT 2001


It seems my question wasn't precise enough. Meanwhile I know better
what I'm looking for ;-)

Currently I'm deleloping several useful scripts that reside in
*different subdirs* of my import hierarchy. I'd like to be able to
call them from an arbitrary directory, without changing that
directory, so for example I could have my own directory listing by
issuing a command like 
  PYTHON MyDir.py
Though MyDir.py is on the import-path, it seems it isn't found for
executing unless I specify explicitly its exact path.

*** So my QUESTION goes like this:
How can I launch scripts that lie in different subdirs in my import
paths from an arbitrary directory without having to specify the path
of the script and without changing the directory?

Martin

On Sat, 07 Apr 2001 08:45:14 GMT, m.bless at gmx.de (Martin Bless) wrote:

>Working in dos boxes of win - but probably independent of this here's
>my question:
>
>ok,   PYTHON   starts Python
>ok,   PYTHON   c:\really\long\path\somewhere\Sweety.py
>executes  my beloved script Sweety.py.
>
>How can I start   Sweety.py   without having to specify that awful
>long path?
>
>Martin




More information about the Python-list mailing list