Help Setting PATH w/Python and Win98

Peter Hansen peter at engcorp.com
Sat Mar 16 13:43:14 EST 2002


Al wrote:
> 
> I am new to programming and am currently doing a Python Tutorial at
>  http://softwaredev.earthweb.com/sdopen/article/0,,12382_626311,00.html
> 
> On that page it says I must set the path in Windows to the directory
> where the Python.exe is located so that I can execute Python script.
> I can get around DOS a bit to do this but not sure how to do it
> exactly.  Could someone tell me what I must do?

If you edit the PATH line in your c:\autoexec.bat file to include
the path to the Python directory and reboot, it will work.  If
the directory is c:\python22 for example, you should add the following
to the PATH line: ";c:\python22" (no quotation marks but include the
semicolon.  For example, you might have

SET PATH=c:\windows;c:\windows\command;c:\python22

> Also it says I must make the directory containing my first script file
> my CURRENT DIRECTORY from the COMMAND PROMPT IN DOS. How do I do this
> too?

You open a DOS prompt from the Start menu (Programs-->MSDOS Prompt) and
then type 'CD directoryname' where directoryname represents the name 
of the folder where you saved your script.  If this were in My Documents,
you would type   CD "My Documents"  for example (include the quotation
marks if there are spaces in the directory name).

On the other hand, the DOS environment is really not a very good place
for a beginner to work, so I would suggest you investigate using the
IDLE development environment instead.  If you installed Python properly,
your Start menu should include a selection for Python and in that, IDLE.
Run that and go from there.  Much easier than DOS!  Good luck.

-Peter



More information about the Python-list mailing list