Newbie python query

Chris Gonnerman chris.gonnerman at usa.net
Sun Apr 8 22:27:40 EDT 2001


----- Original Message -----
From: "Ben Hawkes" <ben.hawkes at paradise.net.nz>
Subject: Newbie python query


> Hi,
>
> I've just started using python on my win95 box, and i'm a bit stuck. I'm
> totally unsure on how to load a .py file into the interpreter and execute
or
> compile it into an executable, HELP!

Python files are not normally compiled into executables; the stock
install doesn't include that capability (it isn't simple).

If you are designing your Python source files (*.py files) in a text
editor, then running them from the command line, you would do:

    python my_program.py

Note that python.exe must be in the path for this to work.  You may
need to amend the path in AUTOEXEC.BAT (and restart the computer)
to add the Python directory.  If you have a vanilla Windoze box,
you would add this to the AUTOEXEC.BAT file:

    set path=c:\windows;c:\windows\command;c:\python20

Your Mileage May Vary.

Alternately, you could use IDLE (check your Start Menu under Programs,
Python 2.0) or install the win32all extensions and use PythonWin
(which gives you an interactive interpreter and editor windows at the
same time).

Hope this helps.






More information about the Python-list mailing list