python at command prompt

david david at nospam.spam
Sun Nov 4 19:03:36 EST 2007


Tim Roberts wrote:
> Ton van Vliet <sheep.in.herd at green.meadow> wrote:
>> There's could also be an issue with entering 'python' at the command
>> line, and not 'python.exe'. Once the PATH is setup correctly, try to
>> enter 'python.exe', and check whether that works.
>>
>> IMHO, to get any 'program-name' (without the .exe extension) to work,
>> one needs to:
>> 1. register the executable with windows (doesn't work for python) or
>> 2. make sure the the PATHEXT environment variable is set correctly,
>> and includes the .EXE extension (on my w2k system it looks like:
>> .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH)
> 
> You're confusing two things here.  Executables (.exe) are always available,
> and do not need to be registered to be run without the extension.
> 
> It is possible to have Windows execute "abc.py" when you type "abc", and
> that DOES require registering the .py extension and adding .py to the
> PATHEXT environment variable.
> 
> A very useful thing to do, by the way.  I have many command line tools for
> which I have forgotten whether they are batch files, small executables, or
> Python scripts.  And that's how it should be.

That is,

"Executables (.exe) are always available,"
... provided that the PATHEXT environment variable
has not been set incorrectly...

and
"Executables ... do not need to be registered"


[david]



More information about the Python-list mailing list