| An Introduction to Python by Guido van Rossum and Fred L. Drake, Jr. Paperback (6"x9"), 124 pages ISBN 0954161769 RRP £12.95 ($19.95) Sales of this book support the Python Software Foundation! Get a printed copy>>> |
2.1.2 Interactive Mode
When commands are read from a tty, the interpreter is said to be in interactive mode. In this mode it prompts for the next command with the primary prompt, usually three greater-than signs (‘>>> ’); for continuation lines it prompts with the secondary prompt, by default three dots (‘... ’). The interpreter prints a welcome message stating its version number and a copyright notice before printing the first prompt:
python
Python 2.5 (r25:51908, Nov 18 2006, 11:52:11)
Type "help", "copyright", "credits" or "license"
for more information.
>>>
Continuation lines are needed when entering a multi-line construct.
As an example, take a look at this if statement:
>>> the_world_is_flat = 1
>>> if the_world_is_flat:
... print "Be careful not to fall off!"
...
Be careful not to fall off!
| ISBN 0954161769 | An Introduction to Python | See the print edition |