python at command prompt

Tim Roberts timr at probo.com
Sat Nov 3 18:51:05 EDT 2007


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.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list