Interpreter Options and Environment

The interpreter has a number of options that control its runtime behavior and environment. On UNIX and Windows, options are given to the interpreter in the form of command-line options such as the following:

python [options] [-c cmd | filename | - ] [args] 

On the Macintosh, options to the Python interpreter are set using a separate program, EditPythonPrefs.

The following command-line options are available:

Option Description
-d Generates parser debugging information.
-h Prints a list of all available command-line options.
-i Enters interactive mode after program execution.
-O Optimized mode.
-OO Optimized mode plus removal of documentation strings.
-S Prevents inclusion of the site initialization module. ...

Get Python Essential Reference, Second 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.