Penguin
Annotated edit history of python2(1) version 2, including all changes. View license author blame.
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 AUTHOR
11 INTERNET RESOURCES
12 LICENSING
13 ----
14 !!NAME
15
16
17 python - an interpreted, interactive, object-oriented programming language
18 !!SYNOPSIS
19
20
21 __python__ [[ __-d__ ] [[ __-i__ ] [[ __-O__ ] [[
22 __-S__ ] [[ __-t__ ] [[ __-u__ ] [[ __-v__ ] [[
23 __-x__ ] [[ __-h__ ] [[ __-V__ ]
24 [[ __-c__ ''command'' | ''script'' | - ] [[
25 ''arguments'' ]
26 !!DESCRIPTION
27
28
29 Python is an interpreted, interactive, object-oriented
30 programming language that combines remarkable power with
31 very clear syntax. For an introduction to programming in
32 Python you are referred to the Python Tutorial. The Python
33 Library Reference documents built-in and standard types,
34 constants, functions and modules. Finally, the Python
35 Reference Manual describes the syntax and semantics of the
36 core language in (perhaps too) much detail. (These documents
37 may be located via the __INTERNET RESOURCES__ below; they
38 may be installed on your system as well.)
39
40
41 Python's basic power can be extended with your own modules
42 written in C or C++. On most systems such modules may be
43 dynamically loaded. Python is also adaptable as an extension
44 language for existing applications. See the internal
45 documentation for hints.
46 !!COMMAND LINE OPTIONS
47
48
49 __-d__
50
51
52 Turn on parser debugging output (for wizards only, depending
53 on compilation options).
54
55
56 __-i__
57
58
59 When a script is passed as first argument or the __-c__
60 option is used, enter interactive mode after executing the
61 script or the command. It does not read the $PYTHONSTARTUP
62 file. This can be useful to inspect global variables or a
63 stack trace when a script raises an exception.
64
65
66 __-O__
67
68
69 Turn on basic optimizations. This changes the filename
70 extension for compiled (bytecode) files from ''.pyc'' to
71 ''.pyo''. Given twice, causes docstrings to be
72 discarded.
73
74
75 __-S__
76
77
78 Disable the import of the module ''site'' and the
79 site-dependent manipulations of ''sys.path'' that it
80 entails.
81
82
83 __-t__
84
85
86 Issue a warning when a source file mixes tabs and spaces for
87 indentation in a way that makes it depend on the worth of a
88 tab expressed in spaces. Issue an error when the option is
89 given twice.
90
91
92 __-u__
93
94
95 Force stdin, stdout and stderr to be totally
96 unbuffered.
97
98
99 __-v__
100
101
102 Print a message each time a module is initialized, showing
103 the place (filename or built-in module) from which it is
104 loaded. When given twice, print a message for each file that
105 is checked for when searching for a module. Also provides
106 information on module cleanup at exit.
107
108
109 __-x__
110
111
112 Skip the first line of the source. This is intended for a
113 DOS specific hack only. Warning: the line numbers in error
114 messages will be off by one!
115
116
117 __-h__
118
119
120 Prints the usage for the interpreter executable and
121 exits.
122
123
124 __-V__
125
126
127 Prints the Python version number of the executable and
128 exits.
129
130
131 __-c__ ''command''
132
133
134 Specify the command to execute (see next section). This
135 terminates the option list (following options are passed as
136 arguments to the command).
137 !!INTERPRETER INTERFACE
138
139
140 The interpreter interface resembles that of the UNIX shell:
141 when called with standard input connected to a tty device,
142 it prompts for commands and executes them until an EOF is
143 read; when called with a file name argument or with a file
144 as standard input, it reads and executes a ''script''
145 from that file; when called with __-c__ ''command,''
146 it executes the Python statement(s) given as ''command.''
147 Here ''command'' may contain multiple statements
148 separated by newlines. Leading whitespace is significant in
149 Python statements! In non-interactive mode, the entire input
150 is parsed befored it is executed.
151
152
153 If available, the script name and additional arguments
154 thereafter are passed to the script in the Python variable
155 ''sys.argv ,'' which is a list of strings (you must first
156 ''import sys'' to be able to access it). If no script
157 name is given, ''sys.argv[[0]'' is an empty string; if
158 __-c__ is used, ''sys.argv[[0]'' contains the string
159 '''-c'.'' Note that options interpreted by the Python
160 interpreter itself are not placed in
161 ''sys.argv.''
162
163
164 In interactive mode, the primary prompt is `
165 sys.ps1'' or ''sys.ps2.'' The interpreter quits
166 when it reads an EOF at a prompt. When an unhandled
167 exception occurs, a stack trace is printed and control
168 returns to the primary prompt; in non-interactive mode, the
169 interpreter exits after printing the stack trace. The
2 perry 170 interrupt signal raises the ''!KeyboardInterrupt''
1 perry 171 exception; other UNIX signals are not caught (except that
172 SIGPIPE is sometimes ignored, in favor of the ''IOError''
173 exception). Error messages are written to
174 stderr.
175 !!FILES AND DIRECTORIES
176
177
178 These are subject to difference depending on local
179 installation conventions; ${prefix} and ${exec_prefix} are
180 installation-dependent and should be interpreted as for GNU
181 software; they may be the same. The default for both is
182 ''/usr/local''.
183
184
185 ''${exec_prefix}/bin/python''
186
187
188 Recommended location of the interpreter.
189
190
191 ''${prefix}/lib/python''
192 ${exec_prefix}/lib/python''
193
194
195 Recommended locations of the directories containing the
196 standard modules.
197
198
199 ''${prefix}/include/python''
200 ${exec_prefix}/include/python''
201
202
203 Recommended locations of the directories containing the
204 include files needed for developing Python extensions and
205 embedding the interpreter.
206
207
208 ''~/.pythonrc.py''
209
210
211 User-specific initialization file loaded by the ''user''
212 module; not used by default or by most
213 applications.
214 !!ENVIRONMENT VARIABLES
215
216
217 PYTHONHOME
218
219
220 Change the location of the standard Python libraries. By
221 default, the libraries are searched in
222 ${prefix}/lib/python
223 /usr/local''. When $PYTHONHOME is
224 set to a single directory, its value replaces both ${prefix}
225 and ${exec_prefix}. To specify different values for these,
226 set $PYTHONHOME to ${prefix}:${exec_prefix}.
227
228
229 PYTHONPATH
230
231
232 Augments the default search path for module files. The
233 format is the same as the shell's $PATH: one or more
234 directory pathnames separated by colons. Non-existant
235 directories are silently ignored. The default search path is
236 installation dependent, but generally begins with
237 ${prefix}/lib/python
238 sys.path .''
239
240
241 PYTHONSTARTUP
242
243
244 If this is the name of a readable file, the Python commands
245 in that file are executed before the first prompt is
246 displayed in interactive mode. The file is executed in the
247 same name space where interactive commands are executed so
248 that objects defined or imported in it can be used without
249 qualification in the interactive session. You can also
250 change the prompts ''sys.ps1'' and ''sys.ps2'' in this
251 file.
252
253
254 PYTHONDEBUG
255
256
257 If this is set to a non-empty string it is equivalent to
258 specifying the __-d__ option.
259
260
261 PYTHONINSPECT
262
263
264 If this is set to a non-empty string it is equivalent to
265 specifying the __-i__ option.
266
267
268 PYTHONUNBUFFERED
269
270
271 If this is set to a non-empty string it is equivalent to
272 specifying the __-u__ option.
273
274
275 PYTHONVERBOSE
276
277
278 If this is set to a non-empty string it is equivalent to
279 specifying the __-v__ option.
280 !!AUTHOR
281
282
283 Guido van Rossum
2 perry 284 !BeOpen.com
1 perry 285 160 Saratoga Avenue
286 Santa Clara, CA 95051
287 USA
288 E-mail: guido@beopen.com, guido@python.org
289 And a cast of thousands.
290 !!INTERNET RESOURCES
291
292
293 Main website: http://www.python.org
2 perry 294 !BeOpen development team: http://pythonlabs.com
1 perry 295 Community website: http://starship.python.net
296 Developer resources:
297 http://sourceforge.net/project/?group_id=5470
298 FTP: ftp://ftp.python.org/pub/python
299 Module repository: http://www.vex.net/parnassus/
300 Newsgroups: comp.lang.python,
301 comp.lang.python.announce
302 !!LICENSING
303
304
305 Python is distributed under an Open Source license. See the
306 file
307 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.