Setting The Path

Alex Martelli aleaxit at yahoo.com
Mon Sep 11 15:32:26 EDT 2000


"No Strezzz Cazzz" <PCP at cazzz.demon.nl> wrote in message
news:968688772.23213.0.pluto.d4ee1bae at news.demon.nl...
    [snip]
> Only I have some problems, I have no idea what to do with this info. I
found
> the location of the PATH as you told me. The System Properties,
environment
> tab. Under "Variable" I get "Path", and next to it, under "Value" I get
> "C:\WINNT\system32;C:\WINNT". And when I highlight "Path" on the bottom
> of the tab it will say "%SystemRoot%\system32;%SystemRoot%" next to
> "Value"
>
> I think this is the Path that I should "set" ?

Yes.  After the closing %, add a semicolon, then the full path to
the location of python's exe, i.e. in your case

    C:\ProgramFiles\Coding\Python

Note that it's likely you have a space between "Program" and "Files",
which is trouble for some programs.  So use the shortform instead:

    C:\Progra~1\Coding\Python

(it's likely that Progra~1 is the shortform of "Program Files", but
I can't guarantee it; use the DIR command on C:\ in a command
box to check).


> Please help me out further:
> What is the purpose of setting the Path? I know it has to do something
with
> me being able to execute Python scripts than but I have no idea how
exactly.

Whenever a program is asked for, without giving its full directory
path but just the name, NT (like Windows, and DOS before it, and
Unix, and Linux, ...) looks for it along the directories listed in the
PATH environment variable; it will run the program of that name
which it first finds along that search.

So, if, at a command box, you now type python, NT will complain
that it cannot find the program -- because it's on a directory not
on the path.  When you have changed your path (and probably
re-booted your machine, that is generally necessary) then the
python.exe will be found and executed once you type just python
at the commandbox prompt; so you'll get the interactive prompt
>>> from Python, after its initial copyright &c message.


> And to what should I change the Path?
>
> The location of Python.exe is:
> C:\ProgramFiles\CoDiNg\Python\python.exe

"C:\WINNT\system32;C:\WINNT;c:\Progra~1" if, as I think,
the program files directory gets abbreviated like this on
your machine.


Alex






More information about the Python-list mailing list