version 2 showing authors affecting page license.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
PYTHON |
|
|
2 |
!!!PYTHON |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
COMMAND LINE OPTIONS |
|
|
7 |
INTERPRETER INTERFACE |
|
|
8 |
FILES AND DIRECTORIES |
|
|
9 |
ENVIRONMENT VARIABLES |
|
|
10 |
SEE ALSO |
|
|
11 |
AUTHOR |
|
|
12 |
INTERNET RESOURCES |
|
|
13 |
COPYRIGHT |
|
|
14 |
---- |
|
|
15 |
!!NAME |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
python - an interpreted, interactive, object-oriented programming language |
|
|
19 |
!!SYNOPSIS |
|
|
20 |
|
|
|
21 |
|
|
|
22 |
__python__ [[ __-d__ ] [[ __-i__ ] [[ __-O__ ] [[ |
|
|
23 |
__-S__ ] [[ __-t__ ] [[ __-u__ ] [[ __-v__ ] [[ |
|
|
24 |
__-x__ ] [[ __-X__ ] |
|
|
25 |
[[ __-c__ ''command'' | ''script'' | - ] [[ |
|
|
26 |
''arguments'' ] |
|
|
27 |
!!DESCRIPTION |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
Python is an interpreted, interactive, object-oriented |
|
|
31 |
programming language that combines remarkable power with |
|
|
32 |
very clear syntax. For an introduction to programming in |
|
|
33 |
Python you are referred to the Python Tutorial. The Python |
|
|
34 |
Library Reference documents built-in and standard types, |
|
|
35 |
constants, functions and modules. Finally, the Python |
|
|
36 |
Reference Manual describes the syntax and semantics of the |
|
|
37 |
core language in (perhaps too) much detail. |
|
|
38 |
|
|
|
39 |
|
|
|
40 |
Python's basic power can be extended with your own modules |
|
|
41 |
written in C or C++. On most systems such modules may be |
|
|
42 |
dynamically loaded. Python is also adaptable as an extension |
|
|
43 |
language for existing applications. See the internal |
|
|
44 |
documentation for hints. |
|
|
45 |
!!COMMAND LINE OPTIONS |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
__-d__ |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
Turn on parser debugging output (for wizards only, depending |
|
|
52 |
on compilation options). |
|
|
53 |
|
|
|
54 |
|
|
|
55 |
__-i__ |
|
|
56 |
|
|
|
57 |
|
|
|
58 |
When a script is passed as first argument or the __-c__ |
|
|
59 |
option is used, enter interactive mode after executing the |
|
|
60 |
script or the command. It does not read the $PYTHONSTARTUP |
|
|
61 |
file. This can be useful to inspect global variables or a |
|
|
62 |
stack trace when a script raises an exception. |
|
|
63 |
|
|
|
64 |
|
|
|
65 |
__-O__ |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
Turn on basic optimizations. This changes the filename |
|
|
69 |
extension for compiled (bytecode) files from ''.pyc'' to |
|
|
70 |
''pyo.'' |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
__-S__ |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
Disable the import of the module ''site'' and the |
|
|
77 |
site-dependent manipulations of ''sys.path'' that it |
|
|
78 |
entails. |
|
|
79 |
|
|
|
80 |
|
|
|
81 |
__-t__ |
|
|
82 |
|
|
|
83 |
|
|
|
84 |
Issue a warning when a source file mixes tabs and spaces for |
|
|
85 |
indentation in a way that makes it depend on the worth of a |
|
|
86 |
tab expressed in spaces. Issue an error when the option is |
|
|
87 |
given twice. |
|
|
88 |
|
|
|
89 |
|
|
|
90 |
__-u__ |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
Force stdin, stdout and stderr to be totally |
|
|
94 |
unbuffered. |
|
|
95 |
|
|
|
96 |
|
|
|
97 |
__-v__ |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
Print a message each time a module is initialized, showing |
|
|
101 |
the place (filename or built-in module) from which it is |
|
|
102 |
loaded. |
|
|
103 |
|
|
|
104 |
|
|
|
105 |
__-x__ |
|
|
106 |
|
|
|
107 |
|
|
|
108 |
Skip the first line of the source. This is intended for a |
|
|
109 |
DOS specific hack only. Warning: the line numbers in error |
|
|
110 |
messages will be off by one! |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
__-X__ |
|
|
114 |
|
|
|
115 |
|
|
|
116 |
Make the standard exceptions strings instead of classes. Use |
|
|
117 |
for backward compatibility with old code only. |
|
|
118 |
|
|
|
119 |
|
|
|
120 |
__-c__ ''command'' |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
Specify the command to execute (see next section). This |
|
|
124 |
terminates the option list (following options are passed as |
|
|
125 |
arguments to the command). |
|
|
126 |
!!INTERPRETER INTERFACE |
|
|
127 |
|
|
|
128 |
|
|
|
129 |
The interpreter interface resembles that of the UNIX shell: |
|
|
130 |
when called with standard input connected to a tty device, |
|
|
131 |
it prompts for commands and executes them until an EOF is |
|
|
132 |
read; when called with a file name argument or with a file |
|
|
133 |
as standard input, it reads and executes a ''script'' |
|
|
134 |
from that file; when called with __-c__ ''command,'' |
|
|
135 |
it executes the Python statement(s) given as ''command.'' |
|
|
136 |
Here ''command'' may contain multiple statements |
|
|
137 |
separated by newlines. Leading whitespace is significant in |
|
|
138 |
Python statements! In non-interactive mode, the entire input |
|
|
139 |
is parsed befored it is executed. |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
If available, the script name and additional arguments |
|
|
143 |
thereafter are passed to the script in the Python variable |
|
|
144 |
''sys.argv ,'' which is a list of strings (you must first |
|
|
145 |
''import sys'' to be able to access it). If no script |
|
|
146 |
name is given, ''sys.argv'' is empty; if __-c__ is |
|
|
147 |
used, ''sys.argv[[0]'' contains the string '''-c'.'' |
|
|
148 |
Note that options interpreted by the Python interpreter |
|
|
149 |
itself are not placed in ''sys.argv.'' |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
In interactive mode, the primary prompt is ` |
|
|
153 |
sys.ps1'' or ''sys.ps2.'' The interpreter quits |
|
|
154 |
when it reads an EOF at a prompt. When an unhandled |
|
|
155 |
exception occurs, a stack trace is printed and control |
|
|
156 |
returns to the primary prompt; in non-interactive mode, the |
|
|
157 |
interpreter exits after printing the stack trace. The |
|
|
158 |
interrupt signal raises the ''!KeyboardInterrupt'' |
|
|
159 |
exception; other UNIX signals are not caught (except that |
|
|
160 |
SIGPIPE is sometimes ignored, in favor of the ''IOError'' |
|
|
161 |
exception). Error messages are written to |
|
|
162 |
stderr. |
|
|
163 |
!!FILES AND DIRECTORIES |
|
|
164 |
|
|
|
165 |
|
|
|
166 |
These are subject to difference depending on local |
|
|
167 |
installation conventions: |
|
|
168 |
|
|
|
169 |
|
|
|
170 |
/usr/local/bin/python |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
Recommended location of the interpreter. |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
/usr/local/lib/python |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
Recommended location of the directory containing the |
|
|
180 |
standard modules. |
|
|
181 |
!!ENVIRONMENT VARIABLES |
|
|
182 |
|
|
|
183 |
|
|
|
184 |
PYTHONHOME |
|
|
185 |
|
|
|
186 |
|
|
|
187 |
Change the location of the standard Python libraries. By |
|
|
188 |
default, the libraries are searched in |
|
|
189 |
|
|
|
190 |
|
|
|
191 |
PYTHONPATH |
|
|
192 |
|
|
|
193 |
|
|
|
194 |
Augments the default search path for module files. The |
|
|
195 |
format is the same as the shell's $PATH: one or more |
|
|
196 |
directory pathnames separated by colons. Non-existant |
|
|
197 |
directories are silently ignored. The default search path is |
|
|
198 |
installation dependent, but generally begins with |
|
|
199 |
sys.path |
|
|
200 |
.'' |
|
|
201 |
|
|
|
202 |
|
|
|
203 |
PYTHONSTARTUP |
|
|
204 |
|
|
|
205 |
|
|
|
206 |
If this is the name of a readable file, the Python commands |
|
|
207 |
in that file are executed before the first prompt is |
|
|
208 |
displayed in interactive mode. The file is executed in the |
|
|
209 |
same name space where interactive commands are executed so |
|
|
210 |
that objects defined or imported in it can be used without |
|
|
211 |
qualification in the interactive session. You can also |
|
|
212 |
change the prompts ''sys.ps1'' and ''sys.ps2'' in this |
|
|
213 |
file. |
|
|
214 |
|
|
|
215 |
|
|
|
216 |
PYTHONDEBUG |
|
|
217 |
|
|
|
218 |
|
|
|
219 |
If this is set to a non-empty string it is equivalent to |
|
|
220 |
specifying the __-d__ option. |
|
|
221 |
|
|
|
222 |
|
|
|
223 |
PYTHONINSPECT |
|
|
224 |
|
|
|
225 |
|
|
|
226 |
If this is set to a non-empty string it is equivalent to |
|
|
227 |
specifying the __-i__ option. |
|
|
228 |
|
|
|
229 |
|
|
|
230 |
PYTHONUNBUFFERED |
|
|
231 |
|
|
|
232 |
|
|
|
233 |
If this is set to a non-empty string it is equivalent to |
|
|
234 |
specifying the __-u__ option. |
|
|
235 |
|
|
|
236 |
|
|
|
237 |
PYTHONVERBOSE |
|
|
238 |
|
|
|
239 |
|
|
|
240 |
If this is set to a non-empty string it is equivalent to |
|
|
241 |
specifying the __-v__ option. |
|
|
242 |
!!SEE ALSO |
|
|
243 |
|
|
|
244 |
|
|
|
245 |
Python Tutorial |
|
|
246 |
Python Library Reference |
|
|
247 |
Python Reference Manual |
|
|
248 |
!!AUTHOR |
|
|
249 |
|
|
|
250 |
|
|
|
251 |
Guido van Rossum |
|
|
252 |
CNRI |
|
|
253 |
1895 Preston White Drive |
|
|
254 |
Reston, VA 20191 |
|
|
255 |
USA |
|
|
256 |
E-mail: guido@cnri.reston.va.us, guido@python.org |
|
|
257 |
And a cast of thousands. |
|
|
258 |
!!INTERNET RESOURCES |
|
|
259 |
|
|
|
260 |
|
|
|
261 |
Web site: http://www.python.org |
|
|
262 |
FTP site: ftp://ftp.python.org |
|
|
263 |
Newsgroup: comp.lang.python |
|
|
264 |
!!COPYRIGHT |
|
|
265 |
|
|
|
266 |
|
|
|
267 |
Copyright 1991-1995 by Stichting Mathematisch Centrum, |
|
|
268 |
Amsterdam, The Netherlands. |
|
|
269 |
|
|
|
270 |
|
|
|
271 |
All Rights Reserved |
|
|
272 |
|
|
|
273 |
|
|
|
274 |
Permission to use, copy, modify, and distribute this |
|
|
275 |
software and its documentation for any purpose and without |
|
|
276 |
fee is hereby granted, provided that the above copyright |
|
|
277 |
notice appear in all copies and that both that copyright |
|
|
278 |
notice and this permission notice appear in supporting |
|
|
279 |
documentation, and that the names of Stichting Mathematisch |
|
|
280 |
Centrum or CWI or Corporation for National Research |
|
|
281 |
Initiatives or CNRI not be used in advertising or publicity |
|
|
282 |
pertaining to distribution of the software without specific, |
|
|
283 |
written prior permission. |
|
|
284 |
|
|
|
285 |
|
|
|
286 |
While CWI is the initial source for this software, a |
|
|
287 |
modified version is made available by the Corporation for |
|
|
288 |
National Research Initiatives (CNRI) at the Internet address |
|
|
289 |
ftp://ftp.python.org. |
|
|
290 |
|
|
|
291 |
|
|
|
292 |
STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL |
|
|
293 |
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL |
|
|
294 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO |
|
|
295 |
EVENT SHALL STICHTING MATHEMATISCH CENTRUM OR CNRI BE LIABLE |
|
|
296 |
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY |
|
|
297 |
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
|
|
298 |
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR |
|
|
299 |
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH |
|
|
300 |
THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|
|
301 |
---- |