[Tutor] Re: Interpreter

Kirby Urner urnerk@qwest.net
Fri, 19 Apr 2002 00:19:46 -0400


On Friday 19 April 2002 01:48 am, GREGORY DRENNAN wrote:
> I have been out of circulation for a few years, and was wondering where do
> I start? Do I need a interactive interpreter, and if I do where can I get
> one?

If you've downloaded and installed Python, you already have
an interactive interpreter -- Python is interactive out of the box.

If you're on Windows, open a DOS box, cd to the python 
directory, and enter python.  You'll get a >>> (prompt) and 
there can enter 2 + 2 and get back 4.  You're on your way!

If you're on Linux (or Mac OSX?), open a term window and do
the same thing (probably python is in /usr/bin which is part of
your path, so you don't have to monkey with your PATH just
now).

Now, if you want a GUI front end (vs. a DOS box or tty-like window),
then you've got IDLE right out of the box (part of the standard 
Python download from www.python.org).  This requires installing Tk, 
which is part of what the Windows installer does for ya.  I think
with Linux you may have to dig /idle out of a tools subdirectory
and stick it in /usr/lib/python2.2/site-packages or wherever your
Python library lives (that's if you compile your own).

IDLE is nice because it gives you a text editor with syntax coloring,
and call tips when you start to enter a function (it tells you about
what arguments it expects).  If you're on Windows, then the 
ActiveState download of Python is worth looking into.  You get
another IDE (interactive development environment) called PythonWin.

A lot of people on *nix (Unix or Linux) use vi (vim, gvim) or emacs
as a text editor, and the regular Python shell in an X-window or
tty session.  You can run gvim (a graphical VI) in Windows too, 
but the DOS box Python shell is less workable in some ways --
I recommend starting with the GUI (IDLE in particular, since it 
comes with plain vanilla Python).  PyCrust is another IDE (check
SourceForge for most recent).  By all means use the Python shell
-- that's a great way to experiment with syntax, write short 
programs (you can do it right at the command line) and get 
immediate feedback.

How to get IDLE working on a Mac I'm not so sure, even though I
did it once (didn't have syntax coloring).  That was on a pre OSX
iMac though.  I also got it running in BeOS once, for kicks (using
the free BeOS that runs in a Windows subdirectory).

Kirby