You are on page 1of 1

Chapter 4

The Python Interpreter

4.1 Launching the Python interpreter


Python can be programmed via the interactive command line (aka the
interpreter or IDE) but anything you code won’t be saved. Once you
close the session it all goes away. To save your program, it’s easiest to
just type it in a text file and save it (be sure to use the .py extension,
i.e. foo.py)
To use the interpreter, type “python” at the command prompt (*nix
and Mac) or launch the Python IDE (Windows and Mac). If you’re
using Windows and installed the Python .msi file, you should be able
to also type Python on the command prompt. The main difference
between the IDE and the command prompt is the command prompt
is part of the operating system while the IDE is part of Python. The
command prompt can be used for other tasks besides messing with
Python; the IDE can only be used for Python. Use whichever you’re
more comfortable with.
If you’re using Linux, BSD, or another *nix operating system, I’ll
assume you technologically-inclined enough to know about the ter-
minal; you probably even know how to get Python up and running
already. For those who aren’t used to opening Terminal or Command
Prompt (same thing, different name on different operating systems),
here’s how to do it.

29

You might also like