1 .TH PYTHON "3 January 1994"
3 python \- an interpreted, interactive, object-oriented programming language
33 Python is an interpreted, interactive, object-oriented programming
34 language that combines remarkable power with very clear syntax.
35 For an introduction to programming in Python you are referred to the
37 The Python Library Reference documents built-in and standard types,
38 constants, functions and modules.
39 Finally, the Python Reference Manual describes the syntax and
40 semantics of the core language in (perhaps too) much detail.
42 Python's basic power can be extended with your own modules written in
44 On some (most?) systems such modules may be dynamically loaded.
45 Python is also adaptable as an extension language for existing
47 See the internal documentation for hints.
48 .SH COMMAND LINE OPTIONS
52 Turn on parser debugging output (for wizards only, depending on
55 When a script is passed as first argument or the \fB\-c\fP option is
56 used, enter interactive mode after executing the script or the
57 command. This can be useful to inspect global variables or a stack
58 trace when a script raises an exception.
61 When executing a program from a file, this option enters interactive
62 mode after the program has completed. It does not read the
66 This hack, eh, feature is intended to help you to find expression
67 statements that print a value. Although a feature of the language, it
68 can sometimes be annoying that when a function is called which returns
71 the value is printed to standard output, and it is not always easy to
72 find which statement is the cause of an unwanted `1', for instance.
73 When this option is set, if an expression statement prints its value,
76 is raised. The resulting stack trace will help you to track down the
80 Print a message each time a module is initialized, showing the place
81 (filename or built-in module) from which it is loaded.
84 Specify the command to execute (see next section).
85 This terminates the option list (following options are passed as
86 arguments to the command).
88 When the interpreter is configured to contain the
90 built-in module for use with the X window system, additional command
91 line options common to most X applications are recognized (by STDWIN),
98 The complete set of options is described in the STDWIN documentation.
99 .SH INTERPRETER INTERFACE
100 The interpreter interface resembles that of the UNIX shell: when
101 called with standard input connected to a tty device, it prompts for
102 commands and executes them until an EOF is read; when called with a
103 file name argument or with a file as standard input, it reads and
110 it executes the Python statement(s) given as
114 may contain multiple statements separated by newlines.
115 Leading whitespace is significant in Python statements!
116 In non-interactive mode, the entire input is parsed befored it is
119 If available, the script name and additional arguments thereafter are
120 passed to the script in the Python variable
122 which is a list of strings (you must first
124 to be able to access it).
125 If no script name is given,
133 Note that options interpreter by the Python interpreter or by STDWIN
137 In interactive mode, the primary prompt is `>>>'; the second prompt
138 (which appears when a command is not complete) is `...'.
139 The prompts can be changed by assignment to
143 The interpreter quits when it reads an EOF at a prompt.
144 When an unhandled exception occurs, a stack trace is printed and
145 control returns to the primary prompt; in non-interactive mode, the
146 interpreter exits after printing the stack trace.
147 The interrupt signal raises the
148 .I Keyboard\%Interrupt
149 exception; other UNIX signals are not caught (except that SIGPIPE is
150 sometimes ignored, in favor of the
152 exception). Error messages are written to stderr.
153 .SH FILES AND DIRECTORIES
154 These are subject to difference depending on local installation
156 .IP /usr/local/bin/python
157 Recommended location of the interpreter.
158 .IP /usr/local/lib/python
159 Recommended location of the directory containing the standard modules.
160 .SH ENVIRONMENT VARIABLES
162 Augments the default search path for module files.
163 The format is the same as the shell's $PATH: one or more directory
164 pathnames separated by colons.
165 Non-existant directories are silently ignored.
166 The default search path is installation dependent, but always begins
167 with `.', (for example,
168 .I .:/usr/local/lib/python ).
169 The default search path is appended to $PYTHONPATH.
170 The search path can be manipulated from within a Python program as the
174 If this is the name of a readable file, the Python commands in that
175 file are executed before the first prompt is displayed in interactive
177 The file is executed in the same name space where interactive commands
178 are executed so that objects defined or imported in it can be used
179 without qualification in the interactive session.
180 You can also change the prompts
186 If this is set to a non-empty string it is equivalent to specifying
187 the \fB\-d\fP option.
189 If this is set to a non-empty string it is equivalent to specifying
190 the \fB\-i\fP option.
192 If this is set to a non-empty string it is equivalent to specifying
193 the \fB\-k\fP option.
195 If this is set to a non-empty string it is equivalent to specifying
196 the \fB\-v\fP option.
200 Python Library Reference
202 Python Reference Manual
208 is imported, it initializes the STDWIN library.
209 If this initialization fails, e.g. because the display connection
210 fails, the interpreter aborts immediately.
214 CWI (Centrum voor Wiskunde en Informatica)
219 E-mail: Guido.van.Rossum@cwi.nl
222 There is a mailing list devoted to Python programming, bugs and
224 To subscribe, send mail containing your real name and e-mail address
226 .I python-list-request@cwi.nl.
228 Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
229 Amsterdam, The Netherlands.
233 Permission to use, copy, modify, and distribute this software and its
234 documentation for any purpose and without fee is hereby granted,
235 provided that the above copyright notice appear in all copies and that
236 both that copyright notice and this permission notice appear in
237 supporting documentation, and that the names of Stichting Mathematisch
238 Centrum or CWI not be used in advertising or publicity pertaining to
239 distribution of the software without specific, written prior permission.
241 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
242 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
243 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
244 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
245 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
246 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
247 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.