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

Robert Amesz rcameszREMOVETHIS at dds.removethistoo.nl
Sun Apr 8 18:24:29 EDT 2001


Martin Bless wrote:

>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?

If you're talking about Windows (which you seem to be) and all you're 
trying to do is save some keystrokes (any other point eludes me, to 
be honest) why don't you make some shortcuts to your PYTHON.EXE with 
the proper commandlines?


Robert Amesz



More information about the Python-list mailing list