| 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
|
|---|
| 7 | python \- 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
|
|---|
| 70 | Python is an interpreted, interactive, object-oriented programming
|
|---|
| 71 | language that combines remarkable power with very clear syntax.
|
|---|
| 72 | For an introduction to programming in Python you are referred to the
|
|---|
| 73 | Python Tutorial.
|
|---|
| 74 | The Python Library Reference documents built-in and standard types,
|
|---|
| 75 | constants, functions and modules.
|
|---|
| 76 | Finally, the Python Reference Manual describes the syntax and
|
|---|
| 77 | semantics of the core language in (perhaps too) much detail.
|
|---|
| 78 | (These documents may be located via the
|
|---|
| 79 | .B "INTERNET RESOURCES"
|
|---|
| 80 | below; they may be installed on your system as well.)
|
|---|
| 81 | .PP
|
|---|
| 82 | Python's basic power can be extended with your own modules written in
|
|---|
| 83 | C or C++.
|
|---|
| 84 | On most systems such modules may be dynamically loaded.
|
|---|
| 85 | Python is also adaptable as an extension language for existing
|
|---|
| 86 | applications.
|
|---|
| 87 | See the internal documentation for hints.
|
|---|
| 88 | .PP
|
|---|
| 89 | Documentation for installed Python modules and packages can be
|
|---|
| 90 | viewed by running the
|
|---|
| 91 | .B pydoc
|
|---|
| 92 | program.
|
|---|
| 93 | .SH COMMAND LINE OPTIONS
|
|---|
| 94 | .TP
|
|---|
| 95 | .BI "\-c " command
|
|---|
| 96 | Specify the command to execute (see next section).
|
|---|
| 97 | This terminates the option list (following options are passed as
|
|---|
| 98 | arguments to the command).
|
|---|
| 99 | .TP
|
|---|
| 100 | .B \-d
|
|---|
| 101 | Turn on parser debugging output (for wizards only, depending on
|
|---|
| 102 | compilation options).
|
|---|
| 103 | .TP
|
|---|
| 104 | .B \-E
|
|---|
| 105 | Ignore environment variables like PYTHONPATH and PYTHONHOME that modify
|
|---|
| 106 | the behavior of the interpreter.
|
|---|
| 107 | .TP
|
|---|
| 108 | .B \-h
|
|---|
| 109 | Prints the usage for the interpreter executable and exits.
|
|---|
| 110 | .TP
|
|---|
| 111 | .B \-i
|
|---|
| 112 | When a script is passed as first argument or the \fB\-c\fP option is
|
|---|
| 113 | used, enter interactive mode after executing the script or the
|
|---|
| 114 | command. It does not read the $PYTHONSTARTUP file. This can be
|
|---|
| 115 | useful to inspect global variables or a stack trace when a script
|
|---|
| 116 | raises an exception.
|
|---|
| 117 | .TP
|
|---|
| 118 | .BI "\-m " module-name
|
|---|
| 119 | Searches
|
|---|
| 120 | .I sys.path
|
|---|
| 121 | for the named module and runs the corresponding
|
|---|
| 122 | .I .py
|
|---|
| 123 | file as a script.
|
|---|
| 124 | .TP
|
|---|
| 125 | .B \-O
|
|---|
| 126 | Turn on basic optimizations. This changes the filename extension for
|
|---|
| 127 | compiled (bytecode) files from
|
|---|
| 128 | .I .pyc
|
|---|
| 129 | to \fI.pyo\fP. Given twice, causes docstrings to be discarded.
|
|---|
| 130 | .TP
|
|---|
| 131 | .BI "\-Q " argument
|
|---|
| 132 | Division control; see PEP 238. The argument must be one of "old" (the
|
|---|
| 133 | default, int/int and long/long return an int or long), "new" (new
|
|---|
| 134 | division semantics, i.e. int/int and long/long returns a float),
|
|---|
| 135 | "warn" (old division semantics with a warning for int/int and
|
|---|
| 136 | long/long), or "warnall" (old division semantics with a warning for
|
|---|
| 137 | all use of the division operator). For a use of "warnall", see the
|
|---|
| 138 | Tools/scripts/fixdiv.py script.
|
|---|
| 139 | .TP
|
|---|
| 140 | .B \-S
|
|---|
| 141 | Disable the import of the module
|
|---|
| 142 | .I site
|
|---|
| 143 | and the site-dependent manipulations of
|
|---|
| 144 | .I sys.path
|
|---|
| 145 | that it entails.
|
|---|
| 146 | .TP
|
|---|
| 147 | .B \-t
|
|---|
| 148 | Issue a warning when a source file mixes tabs and spaces for
|
|---|
| 149 | indentation in a way that makes it depend on the worth of a tab
|
|---|
| 150 | expressed in spaces. Issue an error when the option is given twice.
|
|---|
| 151 | .TP
|
|---|
| 152 | .B \-u
|
|---|
| 153 | Force stdin, stdout and stderr to be totally unbuffered. On systems
|
|---|
| 154 | where it matters, also put stdin, stdout and stderr in binary mode.
|
|---|
| 155 | Note that there is internal buffering in xreadlines(), readlines() and
|
|---|
| 156 | file-object iterators ("for line in sys.stdin") which is not
|
|---|
| 157 | influenced 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
|
|---|
| 161 | Print a message each time a module is initialized, showing the place
|
|---|
| 162 | (filename or built-in module) from which it is loaded. When given
|
|---|
| 163 | twice, print a message for each file that is checked for when
|
|---|
| 164 | searching for a module. Also provides information on module cleanup
|
|---|
| 165 | at exit.
|
|---|
| 166 | .TP
|
|---|
| 167 | .B \-V
|
|---|
| 168 | Prints the Python version number of the executable and exits.
|
|---|
| 169 | .TP
|
|---|
| 170 | .BI "\-W " argument
|
|---|
| 171 | Warning control. Python sometimes prints warning message to
|
|---|
| 172 | .IR sys.stderr .
|
|---|
| 173 | A typical warning message has the following form:
|
|---|
| 174 | .IB file ":" line ": " category ": " message.
|
|---|
| 175 | By default, each warning is printed once for each source line where it
|
|---|
| 176 | occurs. This option controls how often warnings are printed.
|
|---|
| 177 | Multiple
|
|---|
| 178 | .B \-W
|
|---|
| 179 | options may be given; when a warning matches more than one
|
|---|
| 180 | option, the action for the last matching option is performed.
|
|---|
| 181 | Invalid
|
|---|
| 182 | .B \-W
|
|---|
| 183 | options are ignored (a warning message is printed about invalid
|
|---|
|
|---|