source: trunk/essentials/dev-lang/python/Misc/python.man@ 3397

Last change on this file since 3397 was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 12.0 KB
Line 
1.TH PYTHON "1" "$Date: 2005-03-21 01:16:03 +1100 (Mon, 21 Mar 2005) $"
2
3./" To view this file while editing, run it through groff:
4./" groff -Tascii -man python.man | less
5
6.SH NAME
7python \- an interpreted, interactive, object-oriented programming language
8.SH SYNOPSIS
9.B python
10[
11.B \-d
12]
13[
14.B \-E
15]
16[
17.B \-h
18]
19[
20.B \-i
21]
22[
23.B \-m
24.I module-name
25]
26[
27.B \-O
28]
29.br
30 [
31.B -Q
32.I argument
33]
34[
35.B \-S
36]
37[
38.B \-t
39]
40[
41.B \-u
42]
43.br
44 [
45.B \-v
46]
47[
48.B \-V
49]
50[
51.B \-W
52.I argument
53]
54[
55.B \-x
56]
57.br
58 [
59.B \-c
60.I command
61|
62.I script
63|
64\-
65]
66[
67.I arguments
68]
69.SH DESCRIPTION
70Python is an interpreted, interactive, object-oriented programming
71language that combines remarkable power with very clear syntax.
72For an introduction to programming in Python you are referred to the
73Python Tutorial.
74The Python Library Reference documents built-in and standard types,
75constants, functions and modules.
76Finally, the Python Reference Manual describes the syntax and
77semantics of the core language in (perhaps too) much detail.
78(These documents may be located via the
79.B "INTERNET RESOURCES"
80below; they may be installed on your system as well.)
81.PP
82Python's basic power can be extended with your own modules written in
83C or C++.
84On most systems such modules may be dynamically loaded.
85Python is also adaptable as an extension language for existing
86applications.
87See the internal documentation for hints.
88.PP
89Documentation for installed Python modules and packages can be
90viewed by running the
91.B pydoc
92program.
93.SH COMMAND LINE OPTIONS
94.TP
95.BI "\-c " command
96Specify the command to execute (see next section).
97This terminates the option list (following options are passed as
98arguments to the command).
99.TP
100.B \-d
101Turn on parser debugging output (for wizards only, depending on
102compilation options).
103.TP
104.B \-E
105Ignore environment variables like PYTHONPATH and PYTHONHOME that modify
106the behavior of the interpreter.
107.TP
108.B \-h
109Prints the usage for the interpreter executable and exits.
110.TP
111.B \-i
112When a script is passed as first argument or the \fB\-c\fP option is
113used, enter interactive mode after executing the script or the
114command. It does not read the $PYTHONSTARTUP file. This can be
115useful to inspect global variables or a stack trace when a script
116raises an exception.
117.TP
118.BI "\-m " module-name
119Searches
120.I sys.path
121for the named module and runs the corresponding
122.I .py
123file as a script.
124.TP
125.B \-O
126Turn on basic optimizations. This changes the filename extension for
127compiled (bytecode) files from
128.I .pyc
129to \fI.pyo\fP. Given twice, causes docstrings to be discarded.
130.TP
131.BI "\-Q " argument
132Division control; see PEP 238. The argument must be one of "old" (the
133default, int/int and long/long return an int or long), "new" (new
134division semantics, i.e. int/int and long/long returns a float),
135"warn" (old division semantics with a warning for int/int and
136long/long), or "warnall" (old division semantics with a warning for
137all use of the division operator). For a use of "warnall", see the
138Tools/scripts/fixdiv.py script.
139.TP
140.B \-S
141Disable the import of the module
142.I site
143and the site-dependent manipulations of
144.I sys.path
145that it entails.
146.TP
147.B \-t
148Issue a warning when a source file mixes tabs and spaces for
149indentation in a way that makes it depend on the worth of a tab
150expressed in spaces. Issue an error when the option is given twice.
151.TP
152.B \-u
153Force stdin, stdout and stderr to be totally unbuffered. On systems
154where it matters, also put stdin, stdout and stderr in binary mode.
155Note that there is internal buffering in xreadlines(), readlines() and
156file-object iterators ("for line in sys.stdin") which is not
157influenced by this option. To work around this, you will want to use
158"sys.stdin.readline()" inside a "while 1:" loop.
159.TP
160.B \-v
161Print a message each time a module is initialized, showing the place
162(filename or built-in module) from which it is loaded. When given
163twice, print a message for each file that is checked for when
164searching for a module. Also provides information on module cleanup
165at exit.
166.TP
167.B \-V
168Prints the Python version number of the executable and exits.
169.TP
170.BI "\-W " argument
171Warning control. Python sometimes prints warning message to
172.IR sys.stderr .
173A typical warning message has the following form:
174.IB file ":" line ": " category ": " message.
175By default, each warning is printed once for each source line where it
176occurs. This option controls how often warnings are printed.
177Multiple
178.B \-W
179options may be given; when a warning matches more than one
180option, the action for the last matching option is performed.
181Invalid
182.B \-W
183options are ignored (a warning message is printed about invalid