"Pierre Dagenais" <[EMAIL PROTECTED]> wrote


The file test.py is in I:\Python25\MyCode,

There is an inconsistency here.
You say at this point that the drive is I

I've set the environment variable pythonpath as
 C:\>set pythonpath = C:\\Python25\\MyCode

But here you add a folder in the C drive?

Definitively C:\python \python25\mycode\test.py does work.
If you're right about having to give the full path, and I suspect you are, Then this means that python knows to search the currennt working directory for the file to execute, but nowhere else.

Correct, just like every other program.
If you run notepad foo.txt notepad will open a new foo.txt
in the current folder it will not search your drive to find some
other foo.txt that you created prevbiously.
Why would python be any different?

The trick to do what you want is not to execute python but
to execute the script and allow the OS to associate Python
with it.

So either just type the script name into the prompt (assuming
it is on the PATH) or double click in explorer and Windows will
find Python itself.

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to