Chapter 2

The Python Interpreter

Calliopus then made a rare acquisition of crocodiles direct from Egypt, but they suffered badly on the voyage and proved unsatisfactory in the arena ... He had accepted a stray python that had been captured in a market by the vigiles.

—Lindsey Davis, in Two for the Lions

Two for the Lions Kung Fu: The Complete Series
Buy from Barnes & Noble by clicking on the cover


System Properties dialog showing system path
Figure 1.
Modifying your autoexec.bat
Figure 2.
Starting the interpreter in a DOS box
Figure 3.
Basic math
Figure 4.
Running helloworld.py
Figure 5.
Starting IDLE
Figure 6.

Example Programs

There is one example program from this hour:  download chapter2.zip.


Play with the interpreter by running it in a DOS box; play with IDLE. See if you can find differences in the way each behaves.

Vist the Python home page, www.python.org, and find the mailing list page. Sign up for the Tutor mailing list. I’m on it, and many more knowledgable people are too.

We’re all there just to answer your questions and help you get over the “speed bumps” of learning Python. When you can snatch the pebble from our hands, it will be time for you to leave, Grasshopper.

Valid HTML 4.01 Transitional