1 .TH PYTHON "10 April, 1998"
3 python \- an interpreted, interactive, object-oriented programming language
46 Python is an interpreted, interactive, object-oriented programming
47 language that combines remarkable power with very clear syntax.
48 For an introduction to programming in Python you are referred to the
50 The Python Library Reference documents built-in and standard types,
51 constants, functions and modules.
52 Finally, the Python Reference Manual describes the syntax and
53 semantics of the core language in (perhaps too) much detail.
55 Python's basic power can be extended with your own modules written in
57 On most systems such modules may be dynamically loaded.
58 Python is also adaptable as an extension language for existing
60 See the internal documentation for hints.
61 .SH COMMAND LINE OPTIONS
64 Turn on parser debugging output (for wizards only, depending on
68 When a script is passed as first argument or the \fB\-c\fP option is
69 used, enter interactive mode after executing the script or the
70 command. It does not read the $PYTHONSTARTUP file. This can be
71 useful to inspect global variables or a stack trace when a script
75 Turn on basic optimizations. This changes the filename extension for
76 compiled (bytecode) files from
82 Disable the import of the module
84 and the site-dependent manipulations of
89 Issue a warning when a source file mixes tabs and spaces for
90 indentation in a way that makes it depend on the worth of a tab
91 expressed in spaces. Issue an error when the option is given twice.
94 Force stdin, stdout and stderr to be totally unbuffered.
97 Print a message each time a module is initialized, showing the place
98 (filename or built-in module) from which it is loaded.
101 Skip the first line of the source. This is intended for a DOS
102 specific hack only. Warning: the line numbers in error messages will
106 Make the standard exceptions strings instead of classes.
107 Use for backward compatibility with old code only.
110 Specify the command to execute (see next section).
111 This terminates the option list (following options are passed as
112 arguments to the command).
113 .SH INTERPRETER INTERFACE
114 The interpreter interface resembles that of the UNIX shell: when
115 called with standard input connected to a tty device, it prompts for
116 commands and executes them until an EOF is read; when called with a
117 file name argument or with a file as standard input, it reads and
124 it executes the Python statement(s) given as
128 may contain multiple statements separated by newlines.
129 Leading whitespace is significant in Python statements!
130 In non-interactive mode, the entire input is parsed befored it is
133 If available, the script name and additional arguments thereafter are
134 passed to the script in the Python variable
136 which is a list of strings (you must first
138 to be able to access it).
139 If no script name is given,
147 Note that options interpreted by the Python interpreter itself
151 In interactive mode, the primary prompt is `>>>'; the second prompt
152 (which appears when a command is not complete) is `...'.
153 The prompts can be changed by assignment to
157 The interpreter quits when it reads an EOF at a prompt.
158 When an unhandled exception occurs, a stack trace is printed and
159 control returns to the primary prompt; in non-interactive mode, the
160 interpreter exits after printing the stack trace.
161 The interrupt signal raises the
162 .I Keyboard\%Interrupt
163 exception; other UNIX signals are not caught (except that SIGPIPE is
164 sometimes ignored, in favor of the
166 exception). Error messages are written to stderr.
167 .SH FILES AND DIRECTORIES
168 These are subject to difference depending on local installation
170 .IP /usr/local/bin/python
171 Recommended location of the interpreter.
172 .IP /usr/local/lib/python<version>
173 Recommended location of the directory containing the standard modules.
174 .SH ENVIRONMENT VARIABLES
176 Change the location of the standard Python libraries. By default, the
177 libraries are searched in <prefix>/lib/python<version> and
178 <exec_prefix>/lib/python<version>, where <prefix> and <exec_prefix>
179 are installation-dependent directories, both defaulting to
180 /usr/local. When $PYTHONHOME is set to a single directory, its value
181 replaces both <prefix> and <exec_prefix>. To specify different values
182 for these, set $PYTHONHOME to <prefix>:<exec_prefix>.
184 Augments the default search path for module files.
185 The format is the same as the shell's $PATH: one or more directory
186 pathnames separated by colons.
187 Non-existant directories are silently ignored.
188 The default search path is installation dependent, but generally
189 begins with <prefix>/lib/python<version> (see PYTHONHOME below).
190 The default search path is always appended to $PYTHONPATH.
191 If a script argument is given, the directory containing the script is
192 inserted in the path in front of $PYTHONPATH.
193 The search path can be manipulated from within a Python program as the
197 If this is the name of a readable file, the Python commands in that
198 file are executed before the first prompt is displayed in interactive
200 The file is executed in the same name space where interactive commands
201 are executed so that objects defined or imported in it can be used
202 without qualification in the interactive session.
203 You can also change the prompts
209 If this is set to a non-empty string it is equivalent to specifying
210 the \fB\-d\fP option.
212 If this is set to a non-empty string it is equivalent to specifying
213 the \fB\-i\fP option.
215 If this is set to a non-empty string it is equivalent to specifying
216 the \fB\-u\fP option.
218 If this is set to a non-empty string it is equivalent to specifying
219 the \fB\-v\fP option.
223 Python Library Reference
225 Python Reference Manual
230 1895 Preston White Drive
234 E-mail: guido@cnri.reston.va.us, guido@python.org
237 And a cast of thousands.
238 .SH INTERNET RESOURCES
239 Web site: http://www.python.org
241 FTP site: ftp://ftp.python.org
243 Newsgroup: comp.lang.python
245 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
250 Permission to use, copy, modify, and distribute this software and its
251 documentation for any purpose and without fee is hereby granted,
252 provided that the above copyright notice appear in all copies and that
253 both that copyright notice and this permission notice appear in
254 supporting documentation, and that the names of Stichting Mathematisch
255 Centrum or CWI or Corporation for National Research Initiatives or
256 CNRI not be used in advertising or publicity pertaining to
257 distribution of the software without specific, written prior
260 While CWI is the initial source for this software, a modified version
261 is made available by the Corporation for National Research Initiatives
262 (CNRI) at the Internet address ftp://ftp.python.org.
264 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
265 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
266 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
267 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
268 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
269 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
270 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
271 PERFORMANCE OF THIS SOFTWARE.