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

Curt Hagenlocher curt at hagenlocher.org
Wed Sep 3 07:39:55 CEST 2008

One of these days, I'm actually going to remember that I need to click
"Reply All" when posting to this list... .  Sorry for the duplicate,

On Tue, Sep 2, 2008 at 6:45 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> A better way would be to start a command process with
> the Python directory added to PATH just for that
> process.

This is similar to what Visual Studio or the Windows SDK do to give
you a command prompt with the PATH and other environmental variables
setup "correctly" -- they add a shortcut to a batch file that's set to
keep the command prompt open after the batch file runs.

> How easy would that be to do on Windows? Do environment
> variables get inherited by child processes the way
> they do on Unix?

Generally, yes.  I think there's a catch in that there are ways to
start processes that don't make them children of your process, but I
don't remember why I think that.

One other reason not to mess with the PATH -- at least by default --
is that the user may have multiple copies of Python installed.  I know
I have at least one machine with 2.4.5, 2.5.2, 2.6b2 and 3.0b2
installed -- and I don't want *any* of them in my path.

Curt Hagenlocher
curt at hagenlocher.org

More information about the Python-Dev mailing list