February 2006
Intermediate to advanced
648 pages
14h 53m
English
If no program name is given and the standard input to the interpreter is an interactive terminal, Python starts in interactive mode. In this mode, a banner message is printed and the user is presented with a prompt. In addition, the interpreter evaluates the script contained in the PYTHONSTARTUP environment variable (if set). This script is evaluated as if it’s part of the input program (that is, it isn’t loaded using an import statement). One application of this script might be to read a user configuration file such as .pythonrc.
When interactive input is being accepted, two user prompts appear. The >>> prompt appears at the beginning of a new statement; the ... prompt indicates a statement continuation. For example: