import path, script path (was Re: module path)

David Brady daves_spam_dodging_account at
Fri Dec 28 17:42:16 EST 2001

> From: John Machin [mailto:sjmachin at]
> 2. Can somebody please help with the OP's implicit
> but not quite asked
> 2nd part of question: How to set up the path to
> follow when
> prompt> python

I am running Win9x, Win2k, and WinXP, and have
JPSoft's excellent 4Dos and 4NT products for them.  In
them, if you can make python scripts executable by

set .py=c:\Python21\Python.exe
set .pyw=c:\Python21\Python.exe

Or whatever your Python path is, or by adding them to
the environment variables.  Then, if your script file
is anywhere in the executable path (set
PATH=%PATH%;c:\Python21\scripts\), 4Dos or 4NT will go
find Python and run it for you.

I have been told that the standard Windows cmd shell
will do it for you as well, but I don't know how or

Perl has a handy command-line option, -S, which tells
perl to search the PATH for the script if it cannot
find it in the local folder.  I suppose it would be
possible to write a batch file that would run a Python
script to search the cwd and the search path for a
script file, and upon finding it, run Python on that
script there.  Phew... convoluted, but it could
probably be made to work.

Good luck,


David Brady
daves_spam_dodging_account at
I'm feeling very surreal today... or *AM* I?

Do You Yahoo!?
Send your FREE holiday greetings online!

More information about the Python-list mailing list