python at command prompt

Ton van Vliet sheep.in.herd at green.meadow
Mon Nov 5 03:18:25 EST 2007


On Sat, 03 Nov 2007 22:51:05 GMT, Tim Roberts <timr at probo.com> 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)

please note that I state 1 *or* 2

>You're confusing two things here.  Executables (.exe) are always available,
>and do not need to be registered to be run without the extension.

but *only* if the PATHEXT environment variable is setup correctly

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

There are executables (.exe) that have a 'registering' option builtin,
and need to be registered to have their capabilities made available
using the /regserver switch (possibly related to OLE/COM services, but
I'm not an expert here ;-)

see: http://consumer.installshield.com/kb.asp?id=Q108199 (last para)

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

-- 
Ton



More information about the Python-list mailing list