Running Python

Python programs are executed by an interpreter. On most machines, the interpreter can be started by simply typing python. However, many different programming environments for Python are currently available (for example, ActivePython, PythonWin, IDLE, and PythonIDE). In this case, Python is started by launching the appropriate application. When the interpreter starts, a prompt appears at which you can start typing programs into a simple read-evaluation loop. For example, in the following output, the interpreter displays its copyright message and presents the user with the >>> prompt, at which the user types the familiar “Hello World” command:

 Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.