[Python-Dev] Add python.exe to PATH environment variable

Steve Holden steve at holdenweb.com
Sat Sep 6 05:42:09 CEST 2008


Terry Reedy wrote:
> 
> 
> M.-A. Lemburg wrote:
>> On 2008-09-02 23:14, Terry Reedy wrote:
> 
>>> An alternative to manipulating PATH would be to make and add to the
>>> Start Menu a Command Prompt shortcut, call it Command Window or
>>> something, that starts in the Python directory.  Then one could enter
>>>> python or >Scripts/goforit without chdir-ing to the Python directory
>>> first.  The background could even be set to green, for instance, to
>>> differentiate it from the standard Command Prompt window.
>>
>> There already is a menu entry that starts the Python interpreter
>> on Windows, so why not use that ?
> 
> I do and will*, but some people want to start a command window and then
> type 'python' just like they would on *nix (*without having to
> explicitly change to the Python directory*), or be able to run stuff in
> a subdirectory of the Python directory.  So I suggested an alternative
> to the request for PATH manipulation that could easily be done now.
> 
A cleaner (though still dirty) way to achieve this would be to add a
link to the appropriate "python.exe" in a directory already on the path
such as c:\Windows\system32

> * I recently *did* run Python from a command prompt so I could make sure
> it was running 'cmd.exe /u' and try changing the code page (but this is
> another story), but I simply moved to the directory first.  For me, not
> a big deal.
> 
My own solution, on systems where I haven't bothered to add \python25
and python25\Scripts to the PATH, is to simply use

  \python25\python

With tab expansion enabled by default it's easy enough.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/



More information about the Python-Dev mailing list