newbie question

Tim Roberts timr at
Fri Mar 3 08:07:43 CET 2006

Dennis Lee Bieber <wlfraed at> wrote:

>On 1 Mar 2006 12:47:26 -0800, "D" <duncanm255 at> declaimed the
>following in comp.lang.python:
>> Yep, that should work.  Just keep in mind that if python.exe is not in
>> your path, you will need to either specify the entire path to it
>> (i.e. 'C:\python24\python C:\path\to\script\'), or cd into
>> its directory first (i.e. if you want to just run 'python
>> C:\path\to\script\').
>	Actually, on XP at least, some combination of commands enables
>things such that one can run without the "python" or the ".py" (but I
>think it garbages I/O redirection and maybe command line arguments --
>though this one worked)

That's the PATHEXT environment variable.

  C:\tmp>set PATHEXT

If you give a lone file name without an extension, it will try all of those
extensions, in that order, to find an executable.  Just add .PY to the end.

There is a bug in NT's CMD.EXE that screws up redirection of stdin, but
command line arguments and stdout work just fine.
- Tim Roberts, timr at
  Providenza & Boekelheide, Inc.

More information about the Python-list mailing list