mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
Change "\," to just "," in function signatures. This is easier to maintain,
works better with LaTeX2HTML, and allows some simplification of the python.sty macros.
This commit is contained in:
parent
c9a4438c16
commit
cce1090d49
129 changed files with 705 additions and 703 deletions
|
@ -24,7 +24,7 @@ second's worth occupies 2*2*44100 bytes, i.e.\ 176,400 bytes.
|
|||
Module \code{aifc} defines the following function:
|
||||
|
||||
\setindexsubitem{(in module aifc)}
|
||||
\begin{funcdesc}{open}{file\, mode}
|
||||
\begin{funcdesc}{open}{file, mode}
|
||||
Open an AIFF or AIFF-C file and return an object instance with
|
||||
methods that are described below. The argument file is either a
|
||||
string naming a file or a file object. The mode is either the string
|
||||
|
@ -146,7 +146,7 @@ If this parameter is not set, or not set correctly, the file needs to
|
|||
support seeking.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setcomptype}{type\, name}
|
||||
\begin{funcdesc}{setcomptype}{type, name}
|
||||
Specify the compression type. If not specified, the audio data will
|
||||
not be compressed. In AIFF files, compression is not possible. The
|
||||
name parameter should be a human-readable description of the
|
||||
|
@ -155,14 +155,14 @@ string. Currently the following compression types are supported:
|
|||
NONE, ULAW, ALAW, G722.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setparams}{nchannels\, sampwidth\, framerate\, comptype\, compname}
|
||||
\begin{funcdesc}{setparams}{nchannels, sampwidth, framerate, comptype, compname}
|
||||
Set all the above parameters at once. The argument is a tuple
|
||||
consisting of the various parameters. This means that it is possible
|
||||
to use the result of a \code{getparams()} call as argument to
|
||||
\code{setparams()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setmark}{id\, pos\, name}
|
||||
\begin{funcdesc}{setmark}{id, pos, name}
|
||||
Add a mark with the given id (larger than 0), and the given name at
|
||||
the given position. This method can be called at any time before
|
||||
\code{close()}.
|
||||
|
|
|
@ -27,7 +27,7 @@ The module defines the following functions:
|
|||
|
||||
\setindexsubitem{(in module al)}
|
||||
|
||||
\begin{funcdesc}{openport}{name\, direction\optional{\, config}}
|
||||
\begin{funcdesc}{openport}{name, direction\optional{, config}}
|
||||
The name and direction arguments are strings. The optional config
|
||||
argument is a configuration object as returned by
|
||||
\code{al.newconfig()}. The return value is an \dfn{port object};
|
||||
|
@ -44,12 +44,12 @@ The device argument is an integer. The return value is a list of
|
|||
integers containing the data returned by ALqueryparams().
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{getparams}{device\, list}
|
||||
\begin{funcdesc}{getparams}{device, list}
|
||||
The device argument is an integer. The list argument is a list such
|
||||
as returned by \code{queryparams}; it is modified in place (!).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setparams}{device\, list}
|
||||
\begin{funcdesc}{setparams}{device, list}
|
||||
The device argument is an integer. The list argument is a list such
|
||||
as returned by \code{al.queryparams}.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -12,7 +12,7 @@ the exception \code{amoeba.error = 'amoeba.error'}.
|
|||
The module \code{amoeba} defines the following items:
|
||||
|
||||
\setindexsubitem{(in module amoeba)}
|
||||
\begin{funcdesc}{name_append}{path\, cap}
|
||||
\begin{funcdesc}{name_append}{path, cap}
|
||||
Stores a capability in the Amoeba directory tree.
|
||||
Arguments are the pathname (a string) and the capability (a capability
|
||||
object as returned by
|
||||
|
@ -32,7 +32,7 @@ Returns a
|
|||
object, to which various interesting operations apply, described below.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{name_replace}{path\, cap}
|
||||
\begin{funcdesc}{name_replace}{path, cap}
|
||||
Replaces a capability in the Amoeba directory tree.
|
||||
Arguments are the pathname and the new capability.
|
||||
(This differs from
|
||||
|
@ -91,7 +91,7 @@ The following methods are defined for capability objects.
|
|||
Returns a list of the names of the entries in an Amoeba directory.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{b_read}{offset\, maxsize}
|
||||
\begin{funcdesc}{b_read}{offset, maxsize}
|
||||
Reads (at most)
|
||||
\var{maxsize}
|
||||
bytes from a bullet file at offset
|
||||
|
|
|
@ -13,7 +13,7 @@ will be used. Both modules provide the same interface:
|
|||
% at the same time.
|
||||
\setindexsubitem{(in modules anydbm, dumbdbm)}
|
||||
|
||||
\begin{funcdesc}{open}{filename\optional{\, flag\, mode}}
|
||||
\begin{funcdesc}{open}{filename\optional{, flag, mode}}
|
||||
Open the database file \var{filename} and return a corresponding object.
|
||||
The optional \var{flag} argument can be
|
||||
\code{'r'} to open an existing database for reading only,
|
||||
|
|
|
@ -35,7 +35,7 @@ See also built-in module \module{struct}\refbimodindex{struct}.
|
|||
|
||||
The module defines the following function:
|
||||
|
||||
\begin{funcdesc}{array}{typecode\optional{\, initializer}}
|
||||
\begin{funcdesc}{array}{typecode\optional{, initializer}}
|
||||
Return a new array whose items are restricted by \var{typecode}, and
|
||||
initialized from the optional \var{initializer} value, which must be a
|
||||
list or a string. The list or string is passed to the new array's
|
||||
|
@ -77,7 +77,7 @@ integer values. It is useful when reading data from a file written
|
|||
on a machine with a different byte order.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{fromfile}{f\, n}
|
||||
\begin{funcdesc}{fromfile}{f, n}
|
||||
Read \var{n} items (as machine values) from the file object \var{f}
|
||||
and append them to the end of the array. If less than \var{n} items
|
||||
are available, \exception{EOFError} is raised, but the items that were
|
||||
|
@ -98,12 +98,12 @@ array of machine values (i.e. as if it had been read from a
|
|||
file using the \method{fromfile()} method).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{insert}{i\, x}
|
||||
\begin{funcdesc}{insert}{i, x}
|
||||
Insert a new item with value \var{x} in the array before position
|
||||
\var{i}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{read}{f\, n}
|
||||
\begin{funcdesc}{read}{f, n}
|
||||
\deprecated {1.5.1}
|
||||
{Use the \method{fromfile()} method.}
|
||||
Read \var{n} items (as machine values) from the file object \var{f}
|
||||
|
|
|
@ -19,46 +19,46 @@ This exception is raised on all errors, such as unknown number of bytes
|
|||
per sample, etc.
|
||||
\end{excdesc}
|
||||
|
||||
\begin{funcdesc}{add}{fragment1\, fragment2\, width}
|
||||
\begin{funcdesc}{add}{fragment1, fragment2, width}
|
||||
Return a fragment which is the addition of the two samples passed as
|
||||
parameters. \var{width} is the sample width in bytes, either
|
||||
\code{1}, \code{2} or \code{4}. Both fragments should have the same
|
||||
length.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{adpcm2lin}{adpcmfragment\, width\, state}
|
||||
\begin{funcdesc}{adpcm2lin}{adpcmfragment, width, state}
|
||||
Decode an Intel/DVI ADPCM coded fragment to a linear fragment. See
|
||||
the description of \code{lin2adpcm} for details on ADPCM coding.
|
||||
Return a tuple \code{(\var{sample}, \var{newstate})} where the sample
|
||||
has the width specified in \var{width}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{adpcm32lin}{adpcmfragment\, width\, state}
|
||||
\begin{funcdesc}{adpcm32lin}{adpcmfragment, width, state}
|
||||
Decode an alternative 3-bit ADPCM code. See \code{lin2adpcm3} for
|
||||
details.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{avg}{fragment\, width}
|
||||
\begin{funcdesc}{avg}{fragment, width}
|
||||
Return the average over all samples in the fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{avgpp}{fragment\, width}
|
||||
\begin{funcdesc}{avgpp}{fragment, width}
|
||||
Return the average peak-peak value over all samples in the fragment.
|
||||
No filtering is done, so the usefulness of this routine is
|
||||
questionable.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{bias}{fragment\, width\, bias}
|
||||
\begin{funcdesc}{bias}{fragment, width, bias}
|
||||
Return a fragment that is the original fragment with a bias added to
|
||||
each sample.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{cross}{fragment\, width}
|
||||
\begin{funcdesc}{cross}{fragment, width}
|
||||
Return the number of zero crossings in the fragment passed as an
|
||||
argument.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{findfactor}{fragment\, reference}
|
||||
\begin{funcdesc}{findfactor}{fragment, reference}
|
||||
Return a factor \var{F} such that
|
||||
\code{rms(add(fragment, mul(reference, -F)))} is minimal, i.e.,
|
||||
return the factor with which you should multiply \var{reference} to
|
||||
|
@ -68,7 +68,7 @@ should both contain 2-byte samples.
|
|||
The time taken by this routine is proportional to \code{len(fragment)}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{findfit}{fragment\, reference}
|
||||
\begin{funcdesc}{findfit}{fragment, reference}
|
||||
This routine (which only accepts 2-byte sample fragments)
|
||||
|
||||
Try to match \var{reference} as well as possible to a portion of
|
||||
|
@ -82,7 +82,7 @@ and \var{factor} is the (floating-point) factor as per
|
|||
\code{findfactor}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{findmax}{fragment\, length}
|
||||
\begin{funcdesc}{findmax}{fragment, length}
|
||||
Search \var{fragment} for a slice of length \var{length} samples (not
|
||||
bytes!)\ with maximum energy, i.e., return \var{i} for which
|
||||
\code{rms(fragment[i*2:(i+length)*2])} is maximal. The fragments
|
||||
|
@ -91,15 +91,15 @@ should both contain 2-byte samples.
|
|||
The routine takes time proportional to \code{len(fragment)}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{getsample}{fragment\, width\, index}
|
||||
\begin{funcdesc}{getsample}{fragment, width, index}
|
||||
Return the value of sample \var{index} from the fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lin2lin}{fragment\, width\, newwidth}
|
||||
\begin{funcdesc}{lin2lin}{fragment, width, newwidth}
|
||||
Convert samples between 1-, 2- and 4-byte formats.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lin2adpcm}{fragment\, width\, state}
|
||||
\begin{funcdesc}{lin2adpcm}{fragment, width, state}
|
||||
Convert samples to 4 bit Intel/DVI ADPCM encoding. ADPCM coding is an
|
||||
adaptive coding scheme, whereby each 4 bit number is the difference
|
||||
between one sample and the next, divided by a (varying) step. The
|
||||
|
@ -113,41 +113,41 @@ initial call \code{None} can be passed as the state. \var{adpcmfrag}
|
|||
is the ADPCM coded fragment packed 2 4-bit values per byte.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lin2adpcm3}{fragment\, width\, state}
|
||||
\begin{funcdesc}{lin2adpcm3}{fragment, width, state}
|
||||
This is an alternative ADPCM coder that uses only 3 bits per sample.
|
||||
It is not compatible with the Intel/DVI ADPCM coder and its output is
|
||||
not packed (due to laziness on the side of the author). Its use is
|
||||
discouraged.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lin2ulaw}{fragment\, width}
|
||||
\begin{funcdesc}{lin2ulaw}{fragment, width}
|
||||
Convert samples in the audio fragment to U-LAW encoding and return
|
||||
this as a Python string. U-LAW is an audio encoding format whereby
|
||||
you get a dynamic range of about 14 bits using only 8 bit samples. It
|
||||
is used by the Sun audio hardware, among others.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{minmax}{fragment\, width}
|
||||
\begin{funcdesc}{minmax}{fragment, width}
|
||||
Return a tuple consisting of the minimum and maximum values of all
|
||||
samples in the sound fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{max}{fragment\, width}
|
||||
\begin{funcdesc}{max}{fragment, width}
|
||||
Return the maximum of the \emph{absolute value} of all samples in a
|
||||
fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{maxpp}{fragment\, width}
|
||||
\begin{funcdesc}{maxpp}{fragment, width}
|
||||
Return the maximum peak-peak value in the sound fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mul}{fragment\, width\, factor}
|
||||
\begin{funcdesc}{mul}{fragment, width, factor}
|
||||
Return a fragment that has all samples in the original framgent
|
||||
multiplied by the floating-point value \var{factor}. Overflow is
|
||||
silently ignored.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ratecv}{fragment\, width\, nchannels\, inrate\, outrate\, state\optional{\, weightA\, weightB}}
|
||||
\begin{funcdesc}{ratecv}{fragment, width, nchannels, inrate, outrate, state\optional{, weightA, weightB}}
|
||||
Convert the frame rate of the input fragment.
|
||||
|
||||
\code{State} is a tuple containing the state of the converter. The
|
||||
|
@ -158,11 +158,11 @@ The \code{weightA} and \code{weightB} arguments are parameters for a
|
|||
simple digital filter and default to 1 and 0 respectively.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{reverse}{fragment\, width}
|
||||
\begin{funcdesc}{reverse}{fragment, width}
|
||||
Reverse the samples in a fragment and returns the modified fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{rms}{fragment\, width}
|
||||
\begin{funcdesc}{rms}{fragment, width}
|
||||
Return the root-mean-square of the fragment, i.e.
|
||||
\iftexi
|
||||
the square root of the quotient of the sum of all squared sample value,
|
||||
|
@ -177,20 +177,20 @@ divided by the sumber of samples.
|
|||
This is a measure of the power in an audio signal.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{tomono}{fragment\, width\, lfactor\, rfactor}
|
||||
\begin{funcdesc}{tomono}{fragment, width, lfactor, rfactor}
|
||||
Convert a stereo fragment to a mono fragment. The left channel is
|
||||
multiplied by \var{lfactor} and the right channel by \var{rfactor}
|
||||
before adding the two channels to give a mono signal.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{tostereo}{fragment\, width\, lfactor\, rfactor}
|
||||
\begin{funcdesc}{tostereo}{fragment, width, lfactor, rfactor}
|
||||
Generate a stereo fragment from a mono fragment. Each pair of samples
|
||||
in the stereo fragment are computed from the mono sample, whereby left
|
||||
channel samples are multiplied by \var{lfactor} and right channel
|
||||
samples by \var{rfactor}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ulaw2lin}{fragment\, width}
|
||||
\begin{funcdesc}{ulaw2lin}{fragment, width}
|
||||
Convert sound fragments in ULAW encoding to linearly encoded sound
|
||||
fragments. ULAW encoding always uses 8 bits samples, so \var{width}
|
||||
refers only to the sample width of the output fragment here.
|
||||
|
|
|
@ -157,7 +157,7 @@ followed by text composed using the \member{error_message_format}
|
|||
class variable.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{send_response}{code\optional{\, message}}
|
||||
\begin{funcdesc}{send_response}{code\optional{, message}}
|
||||
Sends a response header and logs the accepted request. The HTTP
|
||||
response line is sent, followed by \emph{Server} and \emph{Date}
|
||||
headers. The values for these two headers are picked up from the
|
||||
|
@ -165,7 +165,7 @@ headers. The values for these two headers are picked up from the
|
|||
respectively.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{send_header}{keyword\, value}
|
||||
\begin{funcdesc}{send_header}{keyword, value}
|
||||
Writes a specific MIME header to the output stream. \var{keyword}
|
||||
should specify the header keyword, with \var{value} specifying
|
||||
its value.
|
||||
|
@ -176,7 +176,7 @@ Sends a blank line, indicating the end of the MIME headers in
|
|||
the response.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{log_request}{\optional{code\optional{\, size}}}
|
||||
\begin{funcdesc}{log_request}{\optional{code\optional{, size}}}
|
||||
Logs an accepted (successful) request. \var{code} should specify
|
||||
the numeric HTTP code associated with the response. If a size of
|
||||
the response is available, then it should be passed as the
|
||||
|
|
|
@ -17,7 +17,7 @@ other, unsafe attributes.
|
|||
|
||||
% I've punted on the issue of documenting keyword arguments for now.
|
||||
|
||||
\begin{funcdesc}{Bastion}{object\optional{\, filter\, name\, class}}
|
||||
\begin{funcdesc}{Bastion}{object\optional{, filter, name, class}}
|
||||
Protect the object \var{object}, returning a bastion for the
|
||||
object. Any attempt to access one of the object's attributes will
|
||||
have to be approved by the \var{filter} function; if the access is
|
||||
|
|
|
@ -11,14 +11,14 @@ The \code{binhex} module defines the following functions:
|
|||
|
||||
\setindexsubitem{(in module binhex)}
|
||||
|
||||
\begin{funcdesc}{binhex}{input\, output}
|
||||
\begin{funcdesc}{binhex}{input, output}
|
||||
Convert a binary file with filename \var{input} to binhex file
|
||||
\var{output}. The \var{output} parameter can either be a filename or a
|
||||
file-like object (any object supporting a \var{write} and \var{close}
|
||||
method).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{hexbin}{input\optional{\, output}}
|
||||
\begin{funcdesc}{hexbin}{input\optional{, output}}
|
||||
Decode a binhex file \var{input}. \var{input} may be a filename or a
|
||||
file-like object supporting \var{read} and \var{close} methods.
|
||||
The resulting file is written to a file named \var{output}, unless the
|
||||
|
|
|
@ -191,7 +191,7 @@ Parse a query string given as a string argument (data of type
|
|||
\mimetype{application/x-www-form-urlencoded}).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{parse_multipart}{fp\, pdict}
|
||||
\begin{funcdesc}{parse_multipart}{fp, pdict}
|
||||
Parse input of type \mimetype{multipart/form-data} (for
|
||||
file uploads). Arguments are \var{fp} for the input file and
|
||||
\var{pdict} for the dictionary containing other parameters of
|
||||
|
@ -236,7 +236,7 @@ Print a list of useful (used by CGI) environment variables in
|
|||
HTML.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{escape}{s\optional{\, quote}}
|
||||
\begin{funcdesc}{escape}{s\optional{, quote}}
|
||||
Convert the characters
|
||||
\character{\&}, \character{<} and \character{>} in string \var{s} to
|
||||
HTML-safe sequences. Use this if you need to display text that might
|
||||
|
|
|
@ -10,7 +10,7 @@ attempting to crack \UNIX{} passwords with a dictionary.
|
|||
\index{crypt(3)}
|
||||
|
||||
\setindexsubitem{(in module crypt)}
|
||||
\begin{funcdesc}{crypt}{word\, salt}
|
||||
\begin{funcdesc}{crypt}{word, salt}
|
||||
\var{word} will usually be a user's password. \var{salt} is a
|
||||
2-character string which will be used to select one of 4096 variations
|
||||
of DES\indexii{cipher}{DES}. The characters in \var{salt} must be
|
||||
|
|
|
@ -20,7 +20,7 @@ Raised on dbm-specific errors, such as I/O errors. \code{KeyError} is
|
|||
raised for general mapping errors like specifying an incorrect key.
|
||||
\end{excdesc}
|
||||
|
||||
\begin{funcdesc}{open}{filename\, \optional{flag\, \optional{mode}}}
|
||||
\begin{funcdesc}{open}{filename, \optional{flag, \optional{mode}}}
|
||||
Open a dbm database and return a dbm object. The \var{filename}
|
||||
argument is the name of the database file (without the \file{.dir} or
|
||||
\file{.pag} extensions).
|
||||
|
|
|
@ -49,7 +49,7 @@ traceback if none was passed. The instruction causing the exception
|
|||
is indicated.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{disassemble}{code\optional{\, lasti}}
|
||||
\begin{funcdesc}{disassemble}{code\optional{, lasti}}
|
||||
Disassembles a code object, indicating the last instruction if \var{lasti}
|
||||
was provided. The output is divided in the following columns:
|
||||
\begin{itemize}
|
||||
|
@ -65,7 +65,7 @@ variable names, constant values, branch targets, and compare
|
|||
operators.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{disco}{code\optional{\, lasti}}
|
||||
\begin{funcdesc}{disco}{code\optional{, lasti}}
|
||||
A synonym for disassemble. It is more convenient to type, and kept
|
||||
for compatibility with earlier Python releases.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -66,7 +66,7 @@ Add a hard line break if one does not already exist. This does not
|
|||
break the logical paragraph.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{add_hor_rule}{*args\, **kw}
|
||||
\begin{funcdesc}{add_hor_rule}{*args, **kw}
|
||||
Insert a horizontal rule in the output. A hard break is inserted if
|
||||
there is data in the current paragraph, but the logical paragraph is
|
||||
not broken. The arguments and keywords are passed on to the writer's
|
||||
|
@ -268,7 +268,7 @@ lines, or the equivelent. The \var{blankline} value will be an
|
|||
integer.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{send_hor_rule}{*args\, **kw}
|
||||
\begin{funcdesc}{send_hor_rule}{*args, **kw}
|
||||
Display a horizontal rule on the output device. The arguments to this
|
||||
method are entirely application- and writer-specific, and should be
|
||||
interpreted with care. The method implementation may assume that a
|
||||
|
@ -317,7 +317,7 @@ else. Each method simply announces itself by printing its name and
|
|||
arguments on standard output.
|
||||
\end{classdesc}
|
||||
|
||||
\begin{classdesc}{DumbWriter}{\optional{file\optional{\, maxcol\code{ = 72}}}}
|
||||
\begin{classdesc}{DumbWriter}{\optional{file\optional{, maxcol\code{ = 72}}}}
|
||||
Simple writer class which writes output on the file object passed in
|
||||
as \var{file} or, if \var{file} is omitted, on standard output. The
|
||||
output is simply word-wrapped to the number of columns specified by
|
||||
|
|
|
@ -31,14 +31,14 @@ An object representing the menubar. This object is usually not created
|
|||
by the user.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{Menu}{bar\, title\optional{\, after}}
|
||||
\begin{funcdesc}{Menu}{bar, title\optional{, after}}
|
||||
An object representing a menu. Upon creation you pass the
|
||||
\code{MenuBar} the menu appears in, the \var{title} string and a
|
||||
position (1-based) \var{after} where the menu should appear (default:
|
||||
at the end).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{MenuItem}{menu\, title\optional{\, shortcut\, callback}}
|
||||
\begin{funcdesc}{MenuItem}{menu, title\optional{, shortcut, callback}}
|
||||
Create a menu item object. The arguments are the menu to crate the
|
||||
item it, the item title string and optionally the keyboard shortcut
|
||||
and a callback routine. The callback is called with the arguments
|
||||
|
@ -58,7 +58,7 @@ correct dimming for all menu items based on the current front window.
|
|||
Add a separator to the end of a menu.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{SubMenu}{menu\, label}
|
||||
\begin{funcdesc}{SubMenu}{menu, label}
|
||||
Create a submenu named \var{label} under menu \var{menu}. The menu
|
||||
object is returned.
|
||||
\end{funcdesc}
|
||||
|
@ -72,7 +72,7 @@ which the window belongs. The window is not displayed until later.
|
|||
Creates a modeless dialog window.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{windowbounds}{width\, height}
|
||||
\begin{funcdesc}{windowbounds}{width, height}
|
||||
Return a \code{(left, top, right, bottom)} tuple suitable for creation
|
||||
of a window of given width and height. The window will be staggered
|
||||
with respect to previous windows, and an attempt is made to keep the
|
||||
|
@ -104,7 +104,7 @@ application. Alternatively, override the \code{do_about} method for
|
|||
more elaborate about messages.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mainloop}{\optional{mask\, wait}}
|
||||
\begin{funcdesc}{mainloop}{\optional{mask, wait}}
|
||||
This routine is the main event loop, call it to set your application
|
||||
rolling. \var{Mask} is the mask of events you want to handle,
|
||||
\var{wait} is the number of ticks you want to leave to other
|
||||
|
@ -145,7 +145,7 @@ The old on/off value is returned.
|
|||
Terminate the event \code{mainloop} at the next convenient moment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_char}{c\, event}
|
||||
\begin{funcdesc}{do_char}{c, event}
|
||||
The user typed character \var{c}. The complete details of the event
|
||||
can be found in the \var{event} structure. This method can also be
|
||||
provided in a \code{Window} object, which overrides the
|
||||
|
@ -181,22 +181,22 @@ Override this method to do any special processing on window
|
|||
close. Call \code{self.do_postclose} to cleanup the parent state.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_postresize}{width\, height\, macoswindowid}
|
||||
\begin{funcdesc}{do_postresize}{width, height, macoswindowid}
|
||||
Called after the window is resized. Override if more needs to be done
|
||||
than calling \code{InvalRect}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_contentclick}{local\, modifiers\, event}
|
||||
\begin{funcdesc}{do_contentclick}{local, modifiers, event}
|
||||
The user clicked in the content part of a window. The arguments are
|
||||
the coordinates (window-relative), the key modifiers and the raw
|
||||
event.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_update}{macoswindowid\, event}
|
||||
\begin{funcdesc}{do_update}{macoswindowid, event}
|
||||
An update event for the window was received. Redraw the window.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_activate}{activate\, event}
|
||||
\begin{funcdesc}{do_activate}{activate, event}
|
||||
The window was activated (\code{activate==1}) or deactivated
|
||||
(\code{activate==0}). Handle things like focus highlighting, etc.
|
||||
\end{funcdesc}
|
||||
|
@ -208,7 +208,7 @@ ControlsWindow objects have the following methods besides those of
|
|||
|
||||
\setindexsubitem{(ControlsWindow method)}
|
||||
|
||||
\begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event}
|
||||
\begin{funcdesc}{do_controlhit}{window, control, pcode, event}
|
||||
Part \code{pcode} of control \code{control} was hit by the
|
||||
user. Tracking and such has already been taken care of.
|
||||
\end{funcdesc}
|
||||
|
@ -220,7 +220,7 @@ extra methods:
|
|||
|
||||
\setindexsubitem{(ScrolledWindow method)}
|
||||
|
||||
\begin{funcdesc}{scrollbars}{\optional{wantx\, wanty}}
|
||||
\begin{funcdesc}{scrollbars}{\optional{wantx, wanty}}
|
||||
Create (or destroy) horizontal and vertical scrollbars. The arguments
|
||||
specify which you want (default: both). The scrollbars always have
|
||||
minimum \code{0} and maximum \code{32767}.
|
||||
|
@ -238,32 +238,32 @@ Call this method when the document has changed. It will call
|
|||
\code{getscrollbarvalues} and update the scrollbars.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{scrollbar_callback}{which\, what\, value}
|
||||
\begin{funcdesc}{scrollbar_callback}{which, what, value}
|
||||
Supplied by you and called after user interaction. \code{Which} will
|
||||
be \code{'x'} or \code{'y'}, \code{what} will be \code{'-'},
|
||||
\code{'--'}, \code{'set'}, \code{'++'} or \code{'+'}. For
|
||||
\code{'set'}, \code{value} will contain the new scrollbar position.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{scalebarvalues}{absmin\, absmax\, curmin\, curmax}
|
||||
\begin{funcdesc}{scalebarvalues}{absmin, absmax, curmin, curmax}
|
||||
Auxiliary method to help you calculate values to return from
|
||||
\code{getscrollbarvalues}. You pass document minimum and maximum value
|
||||
and topmost (leftmost) and bottommost (rightmost) visible values and
|
||||
it returns the correct number or \code{None}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_activate}{onoff\, event}
|
||||
\begin{funcdesc}{do_activate}{onoff, event}
|
||||
Takes care of dimming/highlighting scrollbars when a window becomes
|
||||
frontmost vv. If you override this method call this one at the end of
|
||||
your method.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_postresize}{width\, height\, window}
|
||||
\begin{funcdesc}{do_postresize}{width, height, window}
|
||||
Moves scrollbars to the correct position. Call this method initially
|
||||
if you override it.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event}
|
||||
\begin{funcdesc}{do_controlhit}{window, control, pcode, event}
|
||||
Handles scrollbar interaction. If you override it call this method
|
||||
first, a nonzero return value indicates the hit was in the scrollbars
|
||||
and has been handled.
|
||||
|
@ -281,7 +281,7 @@ Create the dialog window, from the DLOG resource with id
|
|||
\var{resid}. The dialog object is stored in \code{self.wid}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_itemhit}{item\, event}
|
||||
\begin{funcdesc}{do_itemhit}{item, event}
|
||||
Item number \var{item} was hit. You are responsible for redrawing
|
||||
toggle buttons, etc.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -54,7 +54,7 @@ find the \code{eggs} variable.
|
|||
complex number, its magnitude is returned.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{apply}{function\, args\optional{, keywords}}
|
||||
\begin{funcdesc}{apply}{function, args\optional{, keywords}}
|
||||
The \var{function} argument must be a callable object (a user-defined or
|
||||
built-in function or method, or a class object) and the \var{args}
|
||||
argument must be a tuple. The \var{function} is called with
|
||||
|
@ -82,20 +82,20 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
inclusive.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{cmp}{x\, y}
|
||||
\begin{funcdesc}{cmp}{x, y}
|
||||
Compare the two objects \var{x} and \var{y} and return an integer
|
||||
according to the outcome. The return value is negative if \code{\var{x}
|
||||
< \var{y}}, zero if \code{\var{x} == \var{y}} and strictly positive if
|
||||
\code{\var{x} > \var{y}}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{coerce}{x\, y}
|
||||
\begin{funcdesc}{coerce}{x, y}
|
||||
Return a tuple consisting of the two numeric arguments converted to
|
||||
a common type, using the same rules as used by arithmetic
|
||||
operations.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{compile}{string\, filename\, kind}
|
||||
\begin{funcdesc}{compile}{string, filename, kind}
|
||||
Compile the \var{string} into a code object. Code objects can be
|
||||
executed by an \keyword{exec} statement or evaluated by a call to
|
||||
\function{eval()}. The \var{filename} argument should
|
||||
|
@ -117,7 +117,7 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
\function{long()} and \function{float()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{delattr}{object\, name}
|
||||
\begin{funcdesc}{delattr}{object, name}
|
||||
This is a relative of \function{setattr()}. The arguments are an
|
||||
object and a string. The string must be the name
|
||||
of one of the object's attributes. The function deletes
|
||||
|
@ -146,7 +146,7 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
\end{verbatim}
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{divmod}{a\, b}
|
||||
\begin{funcdesc}{divmod}{a, b}
|
||||
Take two numbers as arguments and return a pair of numbers consisting
|
||||
of their quotient and remainder when using long division. With mixed
|
||||
operand types, the rules for binary arithmetic operators apply. For
|
||||
|
@ -156,7 +156,7 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
\code{(math.floor(\var{a} / \var{b}), \var{a} \%{} \var{b})}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{eval}{expression\optional{\, globals\optional{\, locals}}}
|
||||
\begin{funcdesc}{eval}{expression\optional{, globals\optional{, locals}}}
|
||||
The arguments are a string and two optional dictionaries. The
|
||||
\var{expression} argument is parsed and evaluated as a Python
|
||||
expression (technically speaking, a condition list) using the
|
||||
|
@ -188,7 +188,7 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
\function{execfile()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{execfile}{file\optional{\, globals\optional{\, locals}}}
|
||||
\begin{funcdesc}{execfile}{file\optional{, globals\optional{, locals}}}
|
||||
This function is similar to the
|
||||
\keyword{exec} statement, but parses a file instead of a string. It
|
||||
is different from the \keyword{import} statement in that it does not
|
||||
|
@ -206,7 +206,7 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
\code{None}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{filter}{function\, list}
|
||||
\begin{funcdesc}{filter}{function, list}
|
||||
Construct a list from those elements of \var{list} for which
|
||||
\var{function} returns true. If \var{list} is a string or a tuple,
|
||||
the result also has that type; otherwise it is always a list. If
|
||||
|
@ -226,7 +226,7 @@ removed.
|
|||
returned.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{getattr}{object\, name}
|
||||
\begin{funcdesc}{getattr}{object, name}
|
||||
The arguments are an object and a string. The string must be the
|
||||
name of one of the object's attributes. The result is the value of
|
||||
that attribute. For example, \code{getattr(\var{x},
|
||||
|
@ -240,7 +240,7 @@ function or method, this is the module where it is defined, not the
|
|||
module from which it is called).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{hasattr}{object\, name}
|
||||
\begin{funcdesc}{hasattr}{object, name}
|
||||
The arguments are an object and a string. The result is 1 if the
|
||||
string is the name of one of the object's attributes, 0 if not.
|
||||
(This is implemented by calling \code{getattr(\var{object},
|
||||
|
@ -355,7 +355,7 @@ desired effect.
|
|||
see the description of \function{int()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{map}{function\, list\, ...}
|
||||
\begin{funcdesc}{map}{function, list, ...}
|
||||
Apply \var{function} to every item of \var{list} and return a list
|
||||
of the results. If additional \var{list} arguments are passed,
|
||||
\var{function} must take that many arguments and is applied to
|
||||
|
@ -388,7 +388,7 @@ any kind of sequence; the result is always a list.
|
|||
\exception{OverflowError} exception.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{open}{filename\optional{\, mode\optional{\, bufsize}}}
|
||||
\begin{funcdesc}{open}{filename\optional{, mode\optional{, bufsize}}}
|
||||
Return a new file object (described earlier under Built-in Types).
|
||||
The first two arguments are the same as for \code{stdio}'s
|
||||
\cfunction{fopen()}: \var{filename} is the file name to be opened,
|
||||
|
@ -423,7 +423,7 @@ there's no reliable way to determine whether this is the case.}
|
|||
\function{chr()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{pow}{x\, y\optional{\, z}}
|
||||
\begin{funcdesc}{pow}{x, y\optional{, z}}
|
||||
Return \var{x} to the power \var{y}; if \var{z} is present, return
|
||||
\var{x} to the power \var{y}, modulo \var{z} (computed more
|
||||
efficiently than \code{pow(\var{x}, \var{y}) \% \var{z}}).
|
||||
|
@ -435,7 +435,7 @@ there's no reliable way to determine whether this is the case.}
|
|||
35000)} is not allowed.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{range}{\optional{start\,} stop\optional{\, step}}
|
||||
\begin{funcdesc}{range}{\optional{start,} stop\optional{, step}}
|
||||
This is a versatile function to create lists containing arithmetic
|
||||
progressions. It is most often used in \keyword{for} loops. The
|
||||
arguments must be plain integers. If the \var{step} argument is
|
||||
|
@ -487,7 +487,7 @@ If the \module{readline} module was loaded, then
|
|||
line editing and history features.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{reduce}{function\, list\optional{\, initializer}}
|
||||
\begin{funcdesc}{reduce}{function, list\optional{, initializer}}
|
||||
Apply the binary \var{function} to the items of \var{list} so as to
|
||||
reduce the list to a single value. E.g.,
|
||||
\code{reduce(lambda x, y: x*y, \var{list}, 1)} returns the product of
|
||||
|
@ -551,7 +551,7 @@ to return a string that would yield an object with the same value
|
|||
when passed to \function{eval()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{round}{x\, n}
|
||||
\begin{funcdesc}{round}{x, n}
|
||||
Return the floating point value \var{x} rounded to \var{n} digits
|
||||
after the decimal point. If \var{n} is omitted, it defaults to zero.
|
||||
The result is a floating point number. Values are rounded to the
|
||||
|
@ -560,7 +560,7 @@ when passed to \function{eval()}.
|
|||
\code{round(0.5)} is \code{1.0} and \code{round(-0.5)} is \code{-1.0}).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setattr}{object\, name\, value}
|
||||
\begin{funcdesc}{setattr}{object, name, value}
|
||||
This is the counterpart of \function{getattr()}. The arguments are an
|
||||
object, a string and an arbitrary value. The string must be the name
|
||||
of one of the object's attributes. The function assigns the value to
|
||||
|
@ -569,7 +569,7 @@ when passed to \function{eval()}.
|
|||
\code{\var{x}.\var{foobar} = 123}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{slice}{\optional{start\,} stop\optional{\, step}}
|
||||
\begin{funcdesc}{slice}{\optional{start,} stop\optional{, step}}
|
||||
Return a slice object representing the set of indices specified by
|
||||
\code{range(\var{start}, \var{stop}, \var{step})}. The \var{start}
|
||||
and \var{step} arguments default to None. Slice objects have
|
||||
|
@ -623,7 +623,7 @@ cannot normally be affected this way, but variables retrieved from
|
|||
other scopes (e.g. modules) can be. This may change.}
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{xrange}{\optional{start\,} stop\optional{\, step}}
|
||||
\begin{funcdesc}{xrange}{\optional{start,} stop\optional{, step}}
|
||||
This function is very similar to \function{range()}, but returns an
|
||||
``xrange object'' instead of a list. This is an opaque sequence type
|
||||
which yields the same values as the corresponding list, without
|
||||
|
|
|
@ -35,7 +35,7 @@ Raised on \code{gdbm}-specific errors, such as I/O errors. \code{KeyError} is
|
|||
raised for general mapping errors like specifying an incorrect key.
|
||||
\end{excdesc}
|
||||
|
||||
\begin{funcdesc}{open}{filename\, \optional{flag\, \optional{mode}}}
|
||||
\begin{funcdesc}{open}{filename, \optional{flag, \optional{mode}}}
|
||||
Open a \code{gdbm} database and return a \code{gdbm} object. The
|
||||
\var{filename} argument is the name of the database file.
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ Similar to
|
|||
but the pairs have the point first and the normal second.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{nurbssurface}{s_k\, t_k\, ctl\, s_ord\, t_ord\, type}
|
||||
\begin{funcdesc}{nurbssurface}{s_k, t_k, ctl, s_ord, t_ord, type}
|
||||
% XXX s_k[], t_k[], ctl[][]
|
||||
Defines a nurbs surface.
|
||||
The dimensions of
|
||||
|
@ -129,13 +129,13 @@ are computed as follows:
|
|||
\code{[len(\var{t_k}) - \var{t_ord}]}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{nurbscurve}{knots\, ctlpoints\, order\, type}
|
||||
\begin{funcdesc}{nurbscurve}{knots, ctlpoints, order, type}
|
||||
Defines a nurbs curve.
|
||||
The length of ctlpoints is
|
||||
\code{len(\var{knots}) - \var{order}}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{pwlcurve}{points\, type}
|
||||
\begin{funcdesc}{pwlcurve}{points, type}
|
||||
Defines a piecewise-linear curve.
|
||||
\var{points}
|
||||
is a list of points.
|
||||
|
|
|
@ -86,7 +86,7 @@ affects the operation of \method{handle_data()} and \method{save_end()}.
|
|||
|
||||
\setindexsubitem{(HTMLParser method)}
|
||||
|
||||
\begin{funcdesc}{anchor_bgn}{href\, name\, type}
|
||||
\begin{funcdesc}{anchor_bgn}{href, name, type}
|
||||
This method is called at the start of an anchor region. The arguments
|
||||
correspond to the attributes of the \code{<A>} tag with the same
|
||||
names. The default implementation maintains a list of hyperlinks
|
||||
|
@ -100,7 +100,7 @@ implementation adds a textual footnote marker using an index into the
|
|||
list of hyperlinks created by \method{anchor_bgn()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{handle_image}{source\, alt\optional{\, ismap\optional{\, align\optional{\, width\optional{\, height}}}}}
|
||||
\begin{funcdesc}{handle_image}{source, alt\optional{, ismap\optional{, align\optional{, width\optional{, height}}}}}
|
||||
This method is called to handle images. The default implementation
|
||||
simply passes the \var{alt} value to the \method{handle_data()}
|
||||
method.
|
||||
|
|
|
@ -17,7 +17,7 @@ per pixel, etc.
|
|||
\end{excdesc}
|
||||
|
||||
|
||||
\begin{funcdesc}{crop}{image\, psize\, width\, height\, x0\, y0\, x1\, y1}
|
||||
\begin{funcdesc}{crop}{image, psize, width, height, x0, y0, x1, y1}
|
||||
Return the selected part of \var{image}, which should by
|
||||
\var{width} by \var{height} in size and consist of pixels of
|
||||
\var{psize} bytes. \var{x0}, \var{y0}, \var{x1} and \var{y1} are like
|
||||
|
@ -28,14 +28,14 @@ that fall outside the old image will have their value set to zero. If
|
|||
holds for the y coordinates.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{scale}{image\, psize\, width\, height\, newwidth\, newheight}
|
||||
\begin{funcdesc}{scale}{image, psize, width, height, newwidth, newheight}
|
||||
Return \var{image} scaled to size \var{newwidth} by \var{newheight}.
|
||||
No interpolation is done, scaling is done by simple-minded pixel
|
||||
duplication or removal. Therefore, computer-generated images or
|
||||
dithered images will not look nice after scaling.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{tovideo}{image\, psize\, width\, height}
|
||||
\begin{funcdesc}{tovideo}{image, psize, width, height}
|
||||
Run a vertical low-pass filter over an image. It does so by computing
|
||||
each destination pixel as the average of two vertically-aligned source
|
||||
pixels. The main use of this routine is to forestall excessive
|
||||
|
@ -43,18 +43,18 @@ flicker if the image is displayed on a video device that uses
|
|||
interlacing, hence the name.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{grey2mono}{image\, width\, height\, threshold}
|
||||
\begin{funcdesc}{grey2mono}{image, width, height, threshold}
|
||||
Convert a 8-bit deep greyscale image to a 1-bit deep image by
|
||||
tresholding all the pixels. The resulting image is tightly packed and
|
||||
is probably only useful as an argument to \code{mono2grey}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{dither2mono}{image\, width\, height}
|
||||
\begin{funcdesc}{dither2mono}{image, width, height}
|
||||
Convert an 8-bit greyscale image to a 1-bit monochrome image using a
|
||||
(simple-minded) dithering algorithm.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mono2grey}{image\, width\, height\, p0\, p1}
|
||||
\begin{funcdesc}{mono2grey}{image, width, height, p0, p1}
|
||||
Convert a 1-bit monochrome image to an 8 bit greyscale or color image.
|
||||
All pixels that are zero-valued on input get value \var{p0} on output
|
||||
and all one-value input pixels get value \var{p1} on output. To
|
||||
|
@ -62,26 +62,26 @@ convert a monochrome black-and-white image to greyscale pass the
|
|||
values \code{0} and \code{255} respectively.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{grey2grey4}{image\, width\, height}
|
||||
\begin{funcdesc}{grey2grey4}{image, width, height}
|
||||
Convert an 8-bit greyscale image to a 4-bit greyscale image without
|
||||
dithering.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{grey2grey2}{image\, width\, height}
|
||||
\begin{funcdesc}{grey2grey2}{image, width, height}
|
||||
Convert an 8-bit greyscale image to a 2-bit greyscale image without
|
||||
dithering.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{dither2grey2}{image\, width\, height}
|
||||
\begin{funcdesc}{dither2grey2}{image, width, height}
|
||||
Convert an 8-bit greyscale image to a 2-bit greyscale image with
|
||||
dithering. As for \code{dither2mono}, the dithering algorithm is
|
||||
currently very simple.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{grey42grey}{image\, width\, height}
|
||||
\begin{funcdesc}{grey42grey}{image, width, height}
|
||||
Convert a 4-bit greyscale image to an 8-bit greyscale image.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{grey22grey}{image\, width\, height}
|
||||
\begin{funcdesc}{grey22grey}{image, width, height}
|
||||
Convert a 2-bit greyscale image to an 8-bit greyscale image.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -30,7 +30,7 @@ the string. This format is suitable to pass to \code{gl.lrectwrite},
|
|||
for instance.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{readscaled}{file\, x\, y\, filter\optional{\, blur}}
|
||||
\begin{funcdesc}{readscaled}{file, x, y, filter\optional{, blur}}
|
||||
This function is identical to read but it returns an image that is
|
||||
scaled to the given \var{x} and \var{y} sizes. If the \var{filter} and
|
||||
\var{blur} parameters are omitted scaling is done by
|
||||
|
@ -55,7 +55,7 @@ compatible with SGI GL) or from top to bottom(flag is one,
|
|||
compatible with X). The default is zero.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{write}{file\, data\, x\, y\, z}
|
||||
\begin{funcdesc}{write}{file, data, x, y, z}
|
||||
This function writes the RGB or greyscale data in \var{data} to image
|
||||
file \var{file}. \var{x} and \var{y} give the size of the image,
|
||||
\var{z} is 1 for 1 byte greyscale images or 3 for RGB images (which are
|
||||
|
|
|
@ -188,7 +188,7 @@ shared libraries is highly system dependent, and not all systems
|
|||
support it.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{load_source}{name\, pathname\, file}
|
||||
\begin{funcdesc}{load_source}{name, pathname, file}
|
||||
Load and initialize a module implemented as a Python source file and
|
||||
return its module object. If the module was already initialized, it
|
||||
will be initialized \emph{again}. The \var{name} argument is used to
|
||||
|
|
|
@ -17,7 +17,7 @@ Configuration Mechanism For Multimedia Mail Format Information,'' but
|
|||
is not an Internet standard. However, mailcap files are supported on
|
||||
most \UNIX{} systems.
|
||||
|
||||
\begin{funcdesc}{findmatch}{caps\, MIMEtype\, key\, filename\, plist}
|
||||
\begin{funcdesc}{findmatch}{caps, MIMEtype, key, filename, plist}
|
||||
Return a 2-tuple; the first element is a string containing the command
|
||||
line to be executed
|
||||
(which can be passed to \code{os.system()}), and the second element is
|
||||
|
|
|
@ -30,18 +30,18 @@ object \var{input} and write the decoded data to open file object
|
|||
\code{'base64'}, \code{'quoted-printable'} and \code{'uuencode'}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{encode}{input\, output\, encoding}
|
||||
\begin{funcdesc}{encode}{input, output, encoding}
|
||||
Read data from open file object \var{input} and write it encoded using
|
||||
the allowed MIME \var{encoding} to open file object \var{output}.
|
||||
Valid values for \var{encoding} are the same as for \method{decode()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{copyliteral}{input\, output}
|
||||
\begin{funcdesc}{copyliteral}{input, output}
|
||||
Read lines until \EOF{} from open file \var{input} and write them to
|
||||
open file \var{output}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{copybinary}{input\, output}
|
||||
\begin{funcdesc}{copybinary}{input, output}
|
||||
Read blocks until \EOF{} from open file \var{input} and write them to
|
||||
open file \var{output}. The block size is currently fixed at 8192.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -36,14 +36,14 @@ provide its own windows, etc.
|
|||
|
||||
\setindexsubitem{(AEServer method)}
|
||||
|
||||
\begin{funcdesc}{installaehandler}{classe\, type\, callback}
|
||||
\begin{funcdesc}{installaehandler}{classe, type, callback}
|
||||
Installs an AppleEvent handler. \code{Classe} and \code{type} are the
|
||||
four-char OSA Class and Type designators, \code{'****'} wildcards are
|
||||
allowed. When a matching AppleEvent is received the parameters are
|
||||
decoded and your callback is invoked.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{callback}{_object\, **kwargs}
|
||||
\begin{funcdesc}{callback}{_object, **kwargs}
|
||||
Your callback is called with the OSA Direct Object as first positional
|
||||
parameter. The other parameters are passed as keyword arguments, with
|
||||
the 4-char designator as name. Three extra keyword parameters are
|
||||
|
|
|
@ -37,17 +37,17 @@ A number of \emph{extra} functions are defined in this module. Non
|
|||
mpz-arguments are converted to mpz-values first, and the functions
|
||||
return mpz-numbers.
|
||||
|
||||
\begin{funcdesc}{powm}{base\, exponent\, modulus}
|
||||
\begin{funcdesc}{powm}{base, exponent, modulus}
|
||||
Return \code{pow(\var{base}, \var{exponent}) \%{} \var{modulus}}. If
|
||||
\code{\var{exponent} == 0}, return \code{mpz(1)}. In contrast to the
|
||||
\C-library function, this version can handle negative exponents.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{gcd}{op1\, op2}
|
||||
\begin{funcdesc}{gcd}{op1, op2}
|
||||
Return the greatest common divisor of \var{op1} and \var{op2}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{gcdext}{a\, b}
|
||||
\begin{funcdesc}{gcdext}{a, b}
|
||||
Return a tuple \code{(\var{g}, \var{s}, \var{t})}, such that
|
||||
\code{\var{a}*\var{s} + \var{b}*\var{t} == \var{g} == gcd(\var{a}, \var{b})}.
|
||||
\end{funcdesc}
|
||||
|
@ -61,7 +61,7 @@ return mpz-numbers.
|
|||
\code{\var{root}*\var{root} + \var{remainder} == \var{op}}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{divm}{numerator\, denominator\, modulus}
|
||||
\begin{funcdesc}{divm}{numerator, denominator, modulus}
|
||||
Returns a number \var{q}. such that
|
||||
\code{\var{q} * \var{denominator} \%{} \var{modulus} == \var{numerator}}.
|
||||
One could also implement this function in Python, using \code{gcdext}.
|
||||
|
|
|
@ -153,7 +153,7 @@ converted to parse trees represented as list- or tuple- trees, or may
|
|||
be compiled into executable code objects. Parse trees may be
|
||||
extracted with or without line numbering information.
|
||||
|
||||
\begin{funcdesc}{ast2list}{ast\optional{\, line_info\code{ = 0}}}
|
||||
\begin{funcdesc}{ast2list}{ast\optional{, line_info\code{ = 0}}}
|
||||
This function accepts an AST object from the caller in
|
||||
\code{\var{ast}} and returns a Python list representing the
|
||||
equivelent parse tree. The resulting list representation can be used
|
||||
|
@ -172,7 +172,7 @@ the line on which the token \emph{ends}. This information is
|
|||
omitted if the flag is false or omitted.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ast2tuple}{ast\optional{\, line_info\code{ = 0}}}
|
||||
\begin{funcdesc}{ast2tuple}{ast\optional{, line_info\code{ = 0}}}
|
||||
This function accepts an AST object from the caller in
|
||||
\code{\var{ast}} and returns a Python tuple representing the
|
||||
equivelent parse tree. Other than returning a tuple instead of a
|
||||
|
@ -184,7 +184,7 @@ representing the token. This information is omitted if the flag is
|
|||
false or omitted.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{compileast}{ast\optional{\, filename\code{ = '<ast>'}}}
|
||||
\begin{funcdesc}{compileast}{ast\optional{, filename\code{ = '<ast>'}}}
|
||||
The Python byte compiler can be invoked on an AST object to produce
|
||||
code objects which can be used as part of an \code{exec} statement or
|
||||
a call to the built-in \function{eval()}\bifuncindex{eval} function.
|
||||
|
|
|
@ -69,7 +69,7 @@ NameError: spam
|
|||
The module defines the following functions; each enters the debugger
|
||||
in a slightly different way:
|
||||
|
||||
\begin{funcdesc}{run}{statement\optional{\, globals\optional{\, locals}}}
|
||||
\begin{funcdesc}{run}{statement\optional{, globals\optional{, locals}}}
|
||||
Execute the \var{statement} (given as a string) under debugger
|
||||
control. The debugger prompt appears before any code is executed; you
|
||||
can set breakpoints and type \code{continue}, or you can step through
|
||||
|
@ -81,14 +81,14 @@ the explanation of the \code{exec} statement or the \code{eval()}
|
|||
built-in function.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{runeval}{expression\optional{\, globals\optional{\, locals}}}
|
||||
\begin{funcdesc}{runeval}{expression\optional{, globals\optional{, locals}}}
|
||||
Evaluate the \var{expression} (given as a a string) under debugger
|
||||
control. When \code{runeval()} returns, it returns the value of the
|
||||
expression. Otherwise this function is similar to
|
||||
\code{run()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{runcall}{function\optional{\, argument\, ...}}
|
||||
\begin{funcdesc}{runcall}{function\optional{, argument, ...}}
|
||||
Call the \var{function} (a function or method object, not a string)
|
||||
with the given arguments. When \code{runcall()} returns, it returns
|
||||
whatever the function call returned. The debugger prompt appears as
|
||||
|
|
|
@ -229,7 +229,7 @@ Collection may also become a problem here.)
|
|||
Apart from the \code{Pickler} and \code{Unpickler} classes, the
|
||||
module defines the following functions, and an exception:
|
||||
|
||||
\begin{funcdesc}{dump}{object\, file\optional{, bin}}
|
||||
\begin{funcdesc}{dump}{object, file\optional{, bin}}
|
||||
Write a pickled representation of \var{obect} to the open file object
|
||||
\var{file}. This is equivalent to
|
||||
\code{Pickler(\var{file}, \var{bin}).dump(\var{object})}.
|
||||
|
|
|
@ -79,11 +79,11 @@ It defines the following functions and constants:
|
|||
Change the current working directory to \var{path}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{chmod}{path\, mode}
|
||||
\begin{funcdesc}{chmod}{path, mode}
|
||||
Change the mode of \var{path} to the numeric \var{mode}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{chown}{path\, uid, gid}
|
||||
\begin{funcdesc}{chown}{path, uid, gid}
|
||||
Change the owner and group id of \var{path} to the numeric \var{uid}
|
||||
and \var{gid}.
|
||||
(Not on MS-DOS.)
|
||||
|
@ -103,19 +103,19 @@ built-in function \function{open()} or by \function{popen()} or
|
|||
Return a duplicate of file descriptor \var{fd}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{dup2}{fd\, fd2}
|
||||
\begin{funcdesc}{dup2}{fd, fd2}
|
||||
Duplicate file descriptor \var{fd} to \var{fd2}, closing the latter
|
||||
first if necessary.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{execv}{path\, args}
|
||||
\begin{funcdesc}{execv}{path, args}
|
||||
Execute the executable \var{path} with argument list \var{args},
|
||||
replacing the current process (i.e., the Python interpreter).
|
||||
The argument list may be a tuple or list of strings.
|
||||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{execve}{path\, args\, env}
|
||||
\begin{funcdesc}{execve}{path, args, env}
|
||||
Execute the executable \var{path} with argument list \var{args},
|
||||
and environment \var{env},
|
||||
replacing the current process (i.e., the Python interpreter).
|
||||
|
@ -134,7 +134,7 @@ Note: the standard way to exit is \code{sys.exit(\var{n})}.
|
|||
after a \function{fork()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{fdopen}{fd\optional{\, mode\optional{\, bufsize}}}
|
||||
\begin{funcdesc}{fdopen}{fd\optional{, mode\optional{, bufsize}}}
|
||||
Return an open file object connected to the file descriptor \var{fd}.
|
||||
The \var{mode} and \var{bufsize} arguments have the same meaning as
|
||||
the corresponding arguments to the built-in \function{open()} function.
|
||||
|
@ -150,7 +150,7 @@ process id in the parent.
|
|||
Return status for file descriptor \var{fd}, like \function{stat()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ftruncate}{fd\, length}
|
||||
\begin{funcdesc}{ftruncate}{fd, length}
|
||||
Truncate the file corresponding to file descriptor \var{fd},
|
||||
so that it is at most \var{length} bytes in size.
|
||||
\end{funcdesc}
|
||||
|
@ -194,12 +194,12 @@ Return the current process' user id.
|
|||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{kill}{pid\, sig}
|
||||
\begin{funcdesc}{kill}{pid, sig}
|
||||
Kill the process \var{pid} with signal \var{sig}.
|
||||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{link}{src\, dst}
|
||||
\begin{funcdesc}{link}{src, dst}
|
||||
Create a hard link pointing to \var{src} named \var{dst}.
|
||||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
@ -211,7 +211,7 @@ entries \code{'.'} and \code{'..'} even if they are present in the
|
|||
directory.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lseek}{fd\, pos\, how}
|
||||
\begin{funcdesc}{lseek}{fd, pos, how}
|
||||
Set the current position of file descriptor \var{fd} to position
|
||||
\var{pos}, modified by \var{how}: \code{0} to set the position
|
||||
relative to the beginning of the file; \code{1} to set it relative to
|
||||
|
@ -224,7 +224,7 @@ Like \function{stat()}, but do not follow symbolic links. (On systems
|
|||
without symbolic links, this is identical to \function{stat()}.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mkfifo}{path\optional{\, mode}}
|
||||
\begin{funcdesc}{mkfifo}{path\optional{, mode}}
|
||||
Create a FIFO (a \POSIX{} named pipe) named \var{path} with numeric mode
|
||||
\var{mode}. The default \var{mode} is \code{0666} (octal). The current
|
||||
umask value is first masked out from the mode.
|
||||
|
@ -238,7 +238,7 @@ the client opens it for writing. Note that \function{mkfifo()}
|
|||
doesn't open the FIFO --- it just creates the rendezvous point.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mkdir}{path\optional{\, mode}}
|
||||
\begin{funcdesc}{mkdir}{path\optional{, mode}}
|
||||
Create a directory named \var{path} with numeric mode \var{mode}.
|
||||
The default \var{mode} is \code{0777} (octal). On some systems,
|
||||
\var{mode} is ignored. Where it is used, the current umask value is
|
||||
|
@ -250,7 +250,7 @@ Add \var{increment} to the process' ``niceness''. Return the new
|
|||
niceness. (Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{open}{file\, flags\optional{\, mode}}
|
||||
\begin{funcdesc}{open}{file, flags\optional{, mode}}
|
||||
Open the file \var{file} and set various flags according to
|
||||
\var{flags} and possibly its mode according to \var{mode}.
|
||||
The default \var{mode} is \code{0777} (octal), and the current umask
|
||||
|
@ -279,7 +279,7 @@ Lock program segments into memory. The value of \var{op}
|
|||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{popen}{command\optional{\, mode\optional{\, bufsize}}}
|
||||
\begin{funcdesc}{popen}{command\optional{, mode\optional{, bufsize}}}
|
||||
Open a pipe to or from \var{command}. The return value is an open
|
||||
file object connected to the pipe, which can be read or written
|
||||
depending on whether \var{mode} is \code{'r'} (default) or \code{'w'}.
|
||||
|
@ -291,7 +291,7 @@ object.
|
|||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{putenv}{varname\, value}
|
||||
\begin{funcdesc}{putenv}{varname, value}
|
||||
\index{environment variables!setting}
|
||||
Set the environment variable named \var{varname} to the string
|
||||
\var{value}. Such changes to the environment affect subprocesses
|
||||
|
@ -309,7 +309,7 @@ actually preferable to assign to items of \code{os.environ}.
|
|||
Return the error message corresponding to the error code in \var{code}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{read}{fd\, n}
|
||||
\begin{funcdesc}{read}{fd, n}
|
||||
Read at most \var{n} bytes from file descriptor \var{fd}.
|
||||
Return a string containing the bytes read.
|
||||
|
||||
|
@ -333,7 +333,7 @@ directory. This is identical to the \function{unlink()} function
|
|||
documented below.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{rename}{src\, dst}
|
||||
\begin{funcdesc}{rename}{src, dst}
|
||||
Rename the file or directory \var{src} to \var{dst}.
|
||||
\end{funcdesc}
|
||||
|
||||
|
@ -353,7 +353,7 @@ Calls the system call \cfunction{setpgrp()} or \cfunction{setpgrp(0,
|
|||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setpgid}{pid\, pgrp}
|
||||
\begin{funcdesc}{setpgid}{pid, pgrp}
|
||||
Calls the system call \cfunction{setpgid()}. See the \UNIX{} manual
|
||||
for the semantics.
|
||||
(Not on MS-DOS.)
|
||||
|
@ -393,7 +393,7 @@ functions and constants that are useful for extracting information
|
|||
from a stat structure.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{symlink}{src\, dst}
|
||||
\begin{funcdesc}{symlink}{src, dst}
|
||||
Create a symbolic link pointing to \var{src} named \var{dst}. (On
|
||||
systems without symbolic links, this always raises \exception{error}.)
|
||||
\end{funcdesc}
|
||||
|
@ -413,7 +413,7 @@ Return the process group associated with the terminal given by
|
|||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{tcsetpgrp}{fd\, pg}
|
||||
\begin{funcdesc}{tcsetpgrp}{fd, pg}
|
||||
Set the process group associated with the terminal given by
|
||||
\var{fd} (an open file descriptor as returned by \function{open()})
|
||||
to \var{pg}.
|
||||
|
@ -453,7 +453,7 @@ Remove the file \var{path}. This is the same function as \code{remove};
|
|||
the \code{unlink} name is its traditional \UNIX{} name.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{utime}{path\, {\rm (}atime, mtime{\rm )}}
|
||||
\begin{funcdesc}{utime}{path, {\rm (}atime, mtime{\rm )}}
|
||||
Set the access and modified time of the file to the given values.
|
||||
(The second argument is a tuple of two items.)
|
||||
\end{funcdesc}
|
||||
|
@ -466,7 +466,7 @@ exit status (if the signal number is zero); the high bit of the low
|
|||
byte is set if a core file was produced. (Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{waitpid}{pid\, options}
|
||||
\begin{funcdesc}{waitpid}{pid, options}
|
||||
Wait for completion of a child process given by proces id, and return
|
||||
a tuple containing its pid and exit status indication (encoded as for
|
||||
\function{wait()}). The semantics of the call are affected by the
|
||||
|
@ -476,7 +476,7 @@ normal operation. (If the system does not support
|
|||
MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{write}{fd\, str}
|
||||
\begin{funcdesc}{write}{fd, str}
|
||||
Write the string \var{str} to file descriptor \var{fd}.
|
||||
Return the number of bytes actually written.
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ different device than \var{p}, or whether \file{\var{p}/..} and
|
|||
detect mount points for all \UNIX{} and \POSIX{} variants.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{join}{p\optional{\, q\optional{\, ...}}}
|
||||
\begin{funcdesc}{join}{p\optional{, q\optional{, ...}}}
|
||||
Joins one or more path components intelligently. If any component is
|
||||
an absolute path, all previous components are thrown away, and joining
|
||||
continues. The return value is the concatenation of \var{p}, and
|
||||
|
@ -103,7 +103,7 @@ case (use \function{normcase()} for that). On Windows, it does
|
|||
converts forward slashes to backward slashes.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{samefile}{p\, q}
|
||||
\begin{funcdesc}{samefile}{p, q}
|
||||
Return true if both pathname arguments refer to the same file or
|
||||
directory (as indicated by device number and i-node number).
|
||||
Raise an exception if a \function{os.stat()} call on either pathname
|
||||
|
@ -130,7 +130,7 @@ and \var{ext} is empty or begins with a period and contains
|
|||
at most one period.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{walk}{p\, visit\, arg}
|
||||
\begin{funcdesc}{walk}{p, visit, arg}
|
||||
Calls the function \var{visit} with arguments
|
||||
\code{(\var{arg}, \var{dirname}, \var{names})} for each directory in the
|
||||
directory tree rooted at \var{p} (including \var{p} itself, if it is a
|
||||
|
|
|
@ -269,7 +269,7 @@ Profiler Extensions, which includes discussion of how to derive
|
|||
``better'' profilers from the classes presented, or reading the source
|
||||
code for these modules.
|
||||
|
||||
\begin{funcdesc}{profile.run}{string\optional{\, filename\optional{\, ...}}}
|
||||
\begin{funcdesc}{profile.run}{string\optional{, filename\optional{, ...}}}
|
||||
|
||||
This function takes a single argument that has can be passed to the
|
||||
\keyword{exec} statement, and an optional file name. In all cases this
|
||||
|
@ -338,7 +338,7 @@ Analysis of the profiler data is done using this class from the
|
|||
|
||||
\setindexsubitem{(in module pstats)}
|
||||
|
||||
\begin{classdesc}{Stats}{filename\optional{\, ...}}
|
||||
\begin{classdesc}{Stats}{filename\optional{, ...}}
|
||||
This class constructor creates an instance of a ``statistics object''
|
||||
from a \var{filename} (or set of filenames). \class{Stats} objects are
|
||||
manipulated by methods, in order to print useful reports.
|
||||
|
@ -375,7 +375,7 @@ statistics for these two entries are accumulated into a single entry.
|
|||
\end{funcdesc}
|
||||
|
||||
|
||||
\begin{funcdesc}{add}{filename\optional{\, ...}}
|
||||
\begin{funcdesc}{add}{filename\optional{, ...}}
|
||||
This method of the \class{Stats} class accumulates additional
|
||||
profiling information into the current profiling object. Its
|
||||
arguments should refer to filenames created by the corresponding
|
||||
|
@ -384,7 +384,7 @@ version of \function{profile.run()}. Statistics for identically named
|
|||
single function statistics.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{sort_stats}{key\optional{\, ...}}
|
||||
\begin{funcdesc}{sort_stats}{key\optional{, ...}}
|
||||
This method modifies the \class{Stats} object by sorting it according
|
||||
to the supplied criteria. The argument is typically a string
|
||||
identifying the basis of a sort (example: \code{"time"} or
|
||||
|
@ -441,7 +441,7 @@ now that ascending vs descending order is properly selected based on
|
|||
the sort key of choice.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{print_stats}{restriction\optional{\, ...}}
|
||||
\begin{funcdesc}{print_stats}{restriction\optional{, ...}}
|
||||
This method for the \class{Stats} class prints out a report as described
|
||||
in the \function{profile.run()} definition.
|
||||
|
||||
|
@ -476,7 +476,7 @@ and then proceed to only print the first 10\% of them.
|
|||
\end{funcdesc}
|
||||
|
||||
|
||||
\begin{funcdesc}{print_callers}{restrictions\optional{\, ...}}
|
||||
\begin{funcdesc}{print_callers}{restrictions\optional{, ...}}
|
||||
This method for the \class{Stats} class prints a list of all functions
|
||||
that called each function in the profiled database. The ordering is
|
||||
identical to that provided by \method{print_stats()}, and the definition
|
||||
|
@ -486,7 +486,7 @@ times this specific call was made. A second non-parenthesized number
|
|||
is the cumulative time spent in the function at the right.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{print_callees}{restrictions\optional{\, ...}}
|
||||
\begin{funcdesc}{print_callees}{restrictions\optional{, ...}}
|
||||
This method for the \class{Stats} class prints a list of all function
|
||||
that were called by the indicated function. Aside from this reversal
|
||||
of direction of calls (re: called vs was called by), the arguments and
|
||||
|
|
|
@ -13,7 +13,7 @@ are many such characters, as when sending a graphics file.
|
|||
|
||||
\setindexsubitem{(in module quopri)}
|
||||
|
||||
\begin{funcdesc}{decode}{input\, output}
|
||||
\begin{funcdesc}{decode}{input, output}
|
||||
Decode the contents of the \var{input} file and write the resulting
|
||||
decoded binary data to the \var{output} file.
|
||||
\var{input} and \var{output} must either be file objects or objects that
|
||||
|
@ -21,7 +21,7 @@ mimic the file object interface. \var{input} will be read until
|
|||
\code{\var{input}.read()} returns an empty string.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{encode}{input\, output\, quotetabs}
|
||||
\begin{funcdesc}{encode}{input, output, quotetabs}
|
||||
Encode the contents of the \var{input} file and write the resulting
|
||||
quoted-printable data to the \var{output} file.
|
||||
\var{input} and \var{output} must either be file objects or objects that
|
||||
|
|
|
@ -192,21 +192,21 @@ The module defines these functions, and an exception:
|
|||
|
||||
\setindexsubitem{(in module regex)}
|
||||
|
||||
\begin{funcdesc}{match}{pattern\, string}
|
||||
\begin{funcdesc}{match}{pattern, string}
|
||||
Return how many characters at the beginning of \var{string} match
|
||||
the regular expression \var{pattern}. Return \code{-1} if the
|
||||
string does not match the pattern (this is different from a
|
||||
zero-length match!).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{search}{pattern\, string}
|
||||
\begin{funcdesc}{search}{pattern, string}
|
||||
Return the first position in \var{string} that matches the regular
|
||||
expression \var{pattern}. Return \code{-1} if no position in the string
|
||||
matches the pattern (this is different from a zero-length match
|
||||
anywhere!).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{compile}{pattern\optional{\, translate}}
|
||||
\begin{funcdesc}{compile}{pattern\optional{, translate}}
|
||||
Compile a regular expression pattern into a regular expression
|
||||
object, which can be used for matching using its \code{match()} and
|
||||
\code{search()} methods, described below. The optional argument
|
||||
|
@ -252,7 +252,7 @@ expressions.)
|
|||
Returns the current value of the syntax flags as an integer.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{symcomp}{pattern\optional{\, translate}}
|
||||
\begin{funcdesc}{symcomp}{pattern\optional{, translate}}
|
||||
This is like \code{compile()}, but supports symbolic group names: if a
|
||||
parenthesis-enclosed group begins with a group name in angular
|
||||
brackets, e.g. \code{'\e(<id>[a-z][a-z0-9]*\e)'}, the group can
|
||||
|
@ -279,7 +279,7 @@ equivalents.
|
|||
Compiled regular expression objects support these methods:
|
||||
|
||||
\setindexsubitem{(regex method)}
|
||||
\begin{funcdesc}{match}{string\optional{\, pos}}
|
||||
\begin{funcdesc}{match}{string\optional{, pos}}
|
||||
Return how many characters at the beginning of \var{string} match
|
||||
the compiled regular expression. Return \code{-1} if the string
|
||||
does not match the pattern (this is different from a zero-length
|
||||
|
@ -293,7 +293,7 @@ Compiled regular expression objects support these methods:
|
|||
is to start.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{search}{string\optional{\, pos}}
|
||||
\begin{funcdesc}{search}{string\optional{, pos}}
|
||||
Return the first position in \var{string} that matches the regular
|
||||
expression \code{pattern}. Return \code{-1} if no position in the
|
||||
string matches the pattern (this is different from a zero-length
|
||||
|
@ -303,7 +303,7 @@ Compiled regular expression objects support these methods:
|
|||
\code{match()} method.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{group}{index\, index\, ...}
|
||||
\begin{funcdesc}{group}{index, index, ...}
|
||||
This method is only valid when the last call to the \code{match()}
|
||||
or \code{search()} method found a match. It returns one or more
|
||||
groups of the match. If there is a single \var{index} argument,
|
||||
|
|
|
@ -20,7 +20,7 @@ conversion help, see the URL
|
|||
|
||||
\setindexsubitem{(in module regsub)}
|
||||
|
||||
\begin{funcdesc}{sub}{pat\, repl\, str}
|
||||
\begin{funcdesc}{sub}{pat, repl, str}
|
||||
Replace the first occurrence of pattern \var{pat} in string
|
||||
\var{str} by replacement \var{repl}. If the pattern isn't found,
|
||||
the string is returned unchanged. The pattern may be a string or an
|
||||
|
@ -28,7 +28,7 @@ already compiled pattern. The replacement may contain references
|
|||
\samp{\e \var{digit}} to subpatterns and escaped backslashes.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{gsub}{pat\, repl\, str}
|
||||
\begin{funcdesc}{gsub}{pat, repl, str}
|
||||
Replace all (non-overlapping) occurrences of pattern \var{pat} in
|
||||
string \var{str} by replacement \var{repl}. The same rules as for
|
||||
\code{sub()} apply. Empty matches for the pattern are replaced only
|
||||
|
@ -36,7 +36,7 @@ when not adjacent to a previous match, so e.g.
|
|||
\code{gsub('', '-', 'abc')} returns \code{'-a-b-c-'}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{split}{str\, pat\optional{\, maxsplit}}
|
||||
\begin{funcdesc}{split}{str, pat\optional{, maxsplit}}
|
||||
Split the string \var{str} in fields separated by delimiters matching
|
||||
the pattern \var{pat}, and return a list containing the fields. Only
|
||||
non-empty matches for the pattern are considered, so e.g.
|
||||
|
@ -47,7 +47,7 @@ occur, and the remainder of the string is returned as the final
|
|||
element of the list.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{splitx}{str\, pat\optional{\, maxsplit}}
|
||||
\begin{funcdesc}{splitx}{str, pat\optional{, maxsplit}}
|
||||
Split the string \var{str} in fields separated by delimiters matching
|
||||
the pattern \var{pat}, and return a list containing the fields as well
|
||||
as the separators. For example, \code{splitx('a:::b', ':*')} returns
|
||||
|
@ -55,7 +55,7 @@ as the separators. For example, \code{splitx('a:::b', ':*')} returns
|
|||
as \code{split}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{capwords}{s\optional{\, pat}}
|
||||
\begin{funcdesc}{capwords}{s\optional{, pat}}
|
||||
Capitalize words separated by optional pattern \var{pat}. The default
|
||||
pattern uses any characters except letters, digits and underscores as
|
||||
word delimiters. Capitalization is done by changing the first
|
||||
|
|
|
@ -151,7 +151,7 @@ Import the module \var{modulename}, raising an \exception{ImportError}
|
|||
exception if the module is considered unsafe.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{r_open}{filename\optional{\, mode\optional{\, bufsize}}}
|
||||
\begin{funcdesc}{r_open}{filename\optional{, mode\optional{, bufsize}}}
|
||||
Method called when \function{open()} is called in the restricted
|
||||
environment. The arguments are identical to those of \function{open()},
|
||||
and a file object (or a class instance compatible with file objects)
|
||||
|
@ -172,7 +172,7 @@ restricted environment's \code{sys.modules} dictionary).
|
|||
|
||||
And their equivalents with access to restricted standard I/O streams:
|
||||
|
||||
\begin{funcdesc}{s_import}{modulename\optional{\, globals, locals, fromlist}}
|
||||
\begin{funcdesc}{s_import}{modulename\optional{, globals, locals, fromlist}}
|
||||
Import the module \var{modulename}, raising an \exception{ImportError}
|
||||
exception if the module is considered unsafe.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -29,7 +29,7 @@ the string. This format is suitable to pass to \code{gl.lrectwrite},
|
|||
for instance.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{longstoimage}{data\, x\, y\, z\, file}
|
||||
\begin{funcdesc}{longstoimage}{data, x, y, z, file}
|
||||
This function writes the RGBA data in \var{data} to image
|
||||
file \var{file}. \var{x} and \var{y} give the size of the image.
|
||||
\var{z} is 1 if the saved image should be 1 byte greyscale, 3 if the
|
||||
|
|
|
@ -25,7 +25,7 @@ order.
|
|||
The available functions in this module are:
|
||||
|
||||
\setindexsubitem{(in module rotor)}
|
||||
\begin{funcdesc}{newrotor}{key\optional{\, numrotors}}
|
||||
\begin{funcdesc}{newrotor}{key\optional{, numrotors}}
|
||||
Return a rotor object. \var{key} is a string containing the encryption key
|
||||
for the object; it can contain arbitrary binary data. The key will be used
|
||||
to randomly generate the rotor permutations and their initial positions.
|
||||
|
|
|
@ -13,7 +13,7 @@ corresponding string, as would be printed by the C function
|
|||
\code{perror()}.
|
||||
\end{excdesc}
|
||||
|
||||
\begin{funcdesc}{select}{iwtd\, owtd\, ewtd\optional{\, timeout}}
|
||||
\begin{funcdesc}{select}{iwtd, owtd, ewtd\optional{, timeout}}
|
||||
This is a straightforward interface to the \UNIX{} \code{select()}
|
||||
system call. The first three arguments are lists of `waitable
|
||||
objects': either integers representing \UNIX{} file descriptors or
|
||||
|
|
|
@ -140,7 +140,7 @@ This method is called when an end tag is found which does not
|
|||
correspond to any open element.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{unknown_starttag}{tag\, attributes}
|
||||
\begin{funcdesc}{unknown_starttag}{tag, attributes}
|
||||
This method is called to process an unknown start tag. It is intended
|
||||
to be overridden by a derived class; the base class implementation
|
||||
does nothing.
|
||||
|
|
|
@ -124,7 +124,7 @@ The \module{signal} module defines the following functions:
|
|||
\UNIX{} man page \manpage{signal}{2}.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{signal}{signalnum\, handler}
|
||||
\begin{funcdesc}{signal}{signalnum, handler}
|
||||
Set the handler for signal \var{signalnum} to the function
|
||||
\var{handler}. \var{handler} can be any callable Python object, or
|
||||
one of the special values \constant{signal.SIG_IGN} or
|
||||
|
|
|
@ -260,7 +260,7 @@ specifies the maximum number of queued connections and should be at
|
|||
least 1; the maximum value is system-dependent (usually 5).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{makefile}{\optional{mode\optional{\, bufsize}}}
|
||||
\begin{funcdesc}{makefile}{\optional{mode\optional{, bufsize}}}
|
||||
Return a \dfn{file object} associated with the socket. (File objects
|
||||
were described earlier in \ref{bltin-file-objects}, ``File Objects.'')
|
||||
The file object references a \cfunction{dup()}ped version of the
|
||||
|
@ -293,7 +293,7 @@ socket. The optional \var{flags} argument has the same meaning as for
|
|||
\method{recv()} above. Returns the number of bytes sent.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{sendto}{string\optional{\, flags}\, address}
|
||||
\begin{funcdesc}{sendto}{string\optional{, flags}, address}
|
||||
Send data to the socket. The socket should not be connected to a
|
||||
remote socket, since the destination socket is specified by
|
||||
\var{address}. The optional \var{flags} argument has the same
|
||||
|
@ -310,7 +310,7 @@ immediately dispose of the data, a \exception{error} exception is
|
|||
raised; in blocking mode, the calls block until they can proceed.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setsockopt}{level\, optname\, value}
|
||||
\begin{funcdesc}{setsockopt}{level, optname, value}
|
||||
Set the value of the given socket option (see the \UNIX{} man page
|
||||
\manpage{setsockopt}{2}). The needed symbolic constants are defined in
|
||||
the \module{socket} module (\code{SO_*} etc.). The value can be an
|
||||
|
|
|
@ -123,14 +123,14 @@ the \emph{new} socket object to be used to communicate with the
|
|||
client, and the client's address.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{handle_error}{request\, client_address}
|
||||
\begin{funcdesc}{handle_error}{request, client_address}
|
||||
This function is called if the \member{RequestHandlerClass}'s
|
||||
\method{handle()} method raises an exception. The default action is
|
||||
to print the traceback to standard output and continue handling
|
||||
further requests.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{process_request}{request\, client_address}
|
||||
\begin{funcdesc}{process_request}{request, client_address}
|
||||
Calls \method{finish_request()} to create an instance of the
|
||||
\member{RequestHandlerClass}. If desired, this function can create a
|
||||
new process or thread to handle the request; the \class{ForkingMixIn}
|
||||
|
@ -151,7 +151,7 @@ Called by the server's constructor to bind the socket to the desired
|
|||
address. May be overridden.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{verify_request}{request\, client_address}
|
||||
\begin{funcdesc}{verify_request}{request, client_address}
|
||||
Must return a Boolean value; if the value is true, the request will be
|
||||
processed, and if it's false, the request will be denied.
|
||||
This function can be overridden to implement access controls for a server.
|
||||
|
|
|
@ -80,16 +80,16 @@ matches any single character.
|
|||
On the Macintosh this function currently returns an empty list.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setdefscrollbars}{hflag\, vflag}
|
||||
\begin{funcdesc}{setdefscrollbars}{hflag, vflag}
|
||||
Set the flags controlling whether subsequently opened windows will
|
||||
have horizontal and/or vertical scroll bars.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setdefwinpos}{h\, v}
|
||||
\begin{funcdesc}{setdefwinpos}{h, v}
|
||||
Set the default window position for windows opened subsequently.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setdefwinsize}{width\, height}
|
||||
\begin{funcdesc}{setdefwinsize}{width, height}
|
||||
Set the default window size for windows opened subsequently.
|
||||
\end{funcdesc}
|
||||
|
||||
|
@ -176,7 +176,7 @@ Note: normally, menus are created locally; see the window method
|
|||
returned by this call exists.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{newbitmap}{width\, height}
|
||||
\begin{funcdesc}{newbitmap}{width, height}
|
||||
Create a new bitmap object of the given dimensions.
|
||||
Methods of bitmap objects are described below.
|
||||
Not available on the Macintosh.
|
||||
|
@ -192,7 +192,7 @@ Display a dialog box containing the string.
|
|||
The user must click OK before the function returns.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{askync}{prompt\, default}
|
||||
\begin{funcdesc}{askync}{prompt, default}
|
||||
Display a dialog that prompts the user to answer a question with yes or
|
||||
no.
|
||||
Return 0 for no, 1 for yes.
|
||||
|
@ -203,7 +203,7 @@ If the user cancels the dialog, the
|
|||
exception is raised.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{askstr}{prompt\, default}
|
||||
\begin{funcdesc}{askstr}{prompt, default}
|
||||
Display a dialog that prompts the user for a string.
|
||||
If the user hits the Return key, the default string is returned.
|
||||
If the user cancels the dialog, the
|
||||
|
@ -211,7 +211,7 @@ If the user cancels the dialog, the
|
|||
exception is raised.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{askfile}{prompt\, default\, new}
|
||||
\begin{funcdesc}{askfile}{prompt, default, new}
|
||||
Ask the user to specify a filename.
|
||||
If
|
||||
\var{new}
|
||||
|
@ -221,7 +221,7 @@ If the user cancels the dialog, the
|
|||
exception is raised.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setcutbuffer}{i\, string}
|
||||
\begin{funcdesc}{setcutbuffer}{i, string}
|
||||
Store the string in the system's cut buffer number
|
||||
\var{i},
|
||||
where it can be found (for pasting) by other applications.
|
||||
|
@ -278,7 +278,7 @@ characters).
|
|||
Return the total line height of the current font.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{textbreak}{str\, width}
|
||||
\begin{funcdesc}{textbreak}{str, width}
|
||||
Return the number of characters of the string that fit into a space of
|
||||
\var{width}
|
||||
bits wide when drawn in the curent font.
|
||||
|
@ -365,7 +365,7 @@ Methods of menu objects are described below.
|
|||
returned by this call exists.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{scroll}{rect\, point}
|
||||
\begin{funcdesc}{scroll}{rect, point}
|
||||
Scroll the given rectangle by the vector given by the point.
|
||||
\end{funcdesc}
|
||||
|
||||
|
@ -378,7 +378,7 @@ Move the origin of the window (its upper left corner)
|
|||
to the given point in the document.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setselection}{i\, str}
|
||||
\begin{funcdesc}{setselection}{i, str}
|
||||
Attempt to set X11 selection number
|
||||
\var{i}
|
||||
to the string
|
||||
|
@ -428,12 +428,12 @@ On X11, there are many more (see
|
|||
\end{sloppypar}
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setwinpos}{h\, v}
|
||||
\begin{funcdesc}{setwinpos}{h, v}
|
||||
Set the the position of the window's upper left corner (relative to
|
||||
the upper left corner of the screen).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setwinsize}{width\, height}
|
||||
\begin{funcdesc}{setwinsize}{width, height}
|
||||
Set the window's size.
|
||||
\end{funcdesc}
|
||||
|
||||
|
@ -474,11 +474,11 @@ Drawing objects have the following methods:
|
|||
Draw a box just inside a rectangle.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{circle}{center\, radius}
|
||||
\begin{funcdesc}{circle}{center, radius}
|
||||
Draw a circle with given center point and radius.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{elarc}{center\, \(rh\, rv\)\, \(a1\, a2\)}
|
||||
\begin{funcdesc}{elarc}{center, \(rh, rv\), \(a1, a2\)}
|
||||
Draw an elliptical arc with given center point.
|
||||
\code{(\var{rh}, \var{rv})}
|
||||
gives the half sizes of the horizontal and vertical radii.
|
||||
|
@ -491,11 +491,11 @@ gives the angles (in degrees) of the begin and end points.
|
|||
Erase a rectangle.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{fillcircle}{center\, radius}
|
||||
\begin{funcdesc}{fillcircle}{center, radius}
|
||||
Draw a filled circle with given center point and radius.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{fillelarc}{center\, \(rh\, rv\)\, \(a1\, a2\)}
|
||||
\begin{funcdesc}{fillelarc}{center, \(rh, rv\), \(a1, a2\)}
|
||||
Draw a filled elliptical arc; arguments as for \code{elarc}.
|
||||
\end{funcdesc}
|
||||
|
||||
|
@ -507,7 +507,7 @@ Draw a filled polygon given by a list (or tuple) of points.
|
|||
Invert a rectangle.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{line}{p1\, p2}
|
||||
\begin{funcdesc}{line}{p1, p2}
|
||||
Draw a line from point
|
||||
\var{p1}
|
||||
to
|
||||
|
@ -522,20 +522,20 @@ Fill a rectangle.
|
|||
Draw the lines connecting the given list (or tuple) of points.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{shade}{rect\, percent}
|
||||
\begin{funcdesc}{shade}{rect, percent}
|
||||
Fill a rectangle with a shading pattern that is about
|
||||
\var{percent}
|
||||
percent filled.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{text}{p\, str}
|
||||
\begin{funcdesc}{text}{p, str}
|
||||
Draw a string starting at point p (the point specifies the
|
||||
top left coordinate of the string).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{xorcircle}{center\, radius}
|
||||
\funcline{xorelarc}{center\, \(rh\, rv\)\, \(a1\, a2\)}
|
||||
\funcline{xorline}{p1\, p2}
|
||||
\begin{funcdesc}{xorcircle}{center, radius}
|
||||
\funcline{xorelarc}{center, \(rh, rv\), \(a1, a2\)}
|
||||
\funcline{xorline}{p1, p2}
|
||||
\funcline{xorpoly}{points}
|
||||
Draw a circle, an elliptical arc, a line or a polygon, respectively,
|
||||
in XOR mode.
|
||||
|
@ -570,7 +570,7 @@ default font, which is in turn initialized from the global default
|
|||
font when the window is created.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{bitmap}{point\, bitmap\, mask}
|
||||
\begin{funcdesc}{bitmap}{point, bitmap, mask}
|
||||
Draw the \var{bitmap} with its top left corner at \var{point}.
|
||||
If the optional \var{mask} argument is present, it should be either
|
||||
the same object as \var{bitmap}, to draw only those bits that are set
|
||||
|
@ -608,23 +608,23 @@ The following methods are defined:
|
|||
|
||||
\setindexsubitem{(menu method)}
|
||||
|
||||
\begin{funcdesc}{additem}{text\, shortcut}
|
||||
\begin{funcdesc}{additem}{text, shortcut}
|
||||
Add a menu item with given text.
|
||||
The shortcut must be a string of length 1, or omitted (to specify no
|
||||
shortcut).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setitem}{i\, text}
|
||||
\begin{funcdesc}{setitem}{i, text}
|
||||
Set the text of item number
|
||||
\var{i}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{enable}{i\, flag}
|
||||
\begin{funcdesc}{enable}{i, flag}
|
||||
Enable or disables item
|
||||
\var{i}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{check}{i\, flag}
|
||||
\begin{funcdesc}{check}{i, flag}
|
||||
Set or clear the
|
||||
\dfn{check mark}
|
||||
for item
|
||||
|
@ -652,7 +652,7 @@ Return a tuple representing the width and height of the bitmap.
|
|||
function.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setbit}{point\, bit}
|
||||
\begin{funcdesc}{setbit}{point, bit}
|
||||
Set the value of the bit indicated by \var{point} to \var{bit}.
|
||||
\end{funcdesc}
|
||||
|
||||
|
@ -691,7 +691,7 @@ Pass a draw event to the text-edit block.
|
|||
The rectangle specifies the redraw area.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{event}{type\, window\, detail}
|
||||
\begin{funcdesc}{event}{type, window, detail}
|
||||
Pass an event gotten from
|
||||
\code{stdwin.getevent()}
|
||||
to the text-edit block.
|
||||
|
@ -727,7 +727,7 @@ Replace the text in the focus by the given string.
|
|||
The new focus is an insert point at the end of the string.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setfocus}{i\, j}
|
||||
\begin{funcdesc}{setfocus}{i, j}
|
||||
Specify the new focus.
|
||||
Out-of-bounds values are silently clipped.
|
||||
\end{funcdesc}
|
||||
|
@ -869,7 +869,7 @@ Returns
|
|||
if the list is empty or all its rectangles are empty.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{pointinrect}{point\, rect}
|
||||
\begin{funcdesc}{pointinrect}{point, rect}
|
||||
Returns true if the point is inside the rectangle.
|
||||
By definition, a point
|
||||
\code{(\var{h}, \var{v})}
|
||||
|
@ -884,7 +884,7 @@ $\var{top} \leq \var{v} < \var{bottom}$.
|
|||
\fi
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{inset}{rect\, \(dh\, dv\)}
|
||||
\begin{funcdesc}{inset}{rect, \(dh, dv\)}
|
||||
Returns a rectangle that lies inside the
|
||||
\code{rect}
|
||||
argument by
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
\section{Standard Module \sectcode{string}}
|
||||
\label{module-string}
|
||||
|
||||
\stmodindex{string}
|
||||
|
||||
This module defines some constants useful for checking character
|
||||
classes and some useful string functions. See the module
|
||||
\code{re} for string functions based on regular expressions.
|
||||
\refstmodindex{re}
|
||||
\module{re}\refstmodindex{re} for string functions based on regular
|
||||
expressions.
|
||||
|
||||
The constants defined in this module are are:
|
||||
|
||||
|
@ -20,16 +19,16 @@ The constants defined in this module are are:
|
|||
\end{datadesc}
|
||||
|
||||
\begin{datadesc}{letters}
|
||||
The concatenation of the strings \code{lowercase} and
|
||||
\code{uppercase} described below.
|
||||
The concatenation of the strings \function{lowercase()} and
|
||||
\function{uppercase()} described below.
|
||||
\end{datadesc}
|
||||
|
||||
\begin{datadesc}{lowercase}
|
||||
A string containing all the characters that are considered lowercase
|
||||
letters. On most systems this is the string
|
||||
\code{'abcdefghijklmnopqrstuvwxyz'}. Do not change its definition ---
|
||||
the effect on the routines \code{upper} and \code{swapcase} is
|
||||
undefined.
|
||||
the effect on the routines \function{upper()} and
|
||||
\function{swapcase()} is undefined.
|
||||
\end{datadesc}
|
||||
|
||||
\begin{datadesc}{octdigits}
|
||||
|
@ -40,16 +39,16 @@ The constants defined in this module are are:
|
|||
A string containing all the characters that are considered uppercase
|
||||
letters. On most systems this is the string
|
||||
\code{'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}. Do not change its definition ---
|
||||
the effect on the routines \code{lower} and \code{swapcase} is
|
||||
undefined.
|
||||
the effect on the routines \function{lower()} and
|
||||
\function{swapcase()} is undefined.
|
||||
\end{datadesc}
|
||||
|
||||
\begin{datadesc}{whitespace}
|
||||
A string containing all characters that are considered whitespace.
|
||||
On most systems this includes the characters space, tab, linefeed,
|
||||
return, formfeed, and vertical tab. Do not change its definition ---
|
||||
the effect on the routines \code{strip} and \code{split} is
|
||||
undefined.
|
||||
the effect on the routines \function{strip()} and \function{split()}
|
||||
is undefined.
|
||||
\end{datadesc}
|
||||
|
||||
The functions defined in this module are:
|
||||
|
@ -60,10 +59,11 @@ The functions defined in this module are:
|
|||
Convert a string to a floating point number. The string must have
|
||||
the standard syntax for a floating point literal in Python, optionally
|
||||
preceded by a sign (\samp{+} or \samp{-}). Note that this behaves
|
||||
identical to the built-in function \code{float()} when passed a string.
|
||||
identical to the built-in function
|
||||
\function{float()}\bifuncindex{float} when passed a string.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{atoi}{s\optional{\, base}}
|
||||
\begin{funcdesc}{atoi}{s\optional{, base}}
|
||||
Convert string \var{s} to an integer in the given \var{base}. The
|
||||
string must consist of one or more digits, optionally preceded by a
|
||||
sign (\samp{+} or \samp{-}). The \var{base} defaults to 10. If it is
|
||||
|
@ -72,20 +72,20 @@ string (after stripping the sign): \samp{0x} or \samp{0X} means 16,
|
|||
\samp{0} means 8, anything else means 10. If \var{base} is 16, a
|
||||
leading \samp{0x} or \samp{0X} is always accepted. Note that when
|
||||
invoked without \var{base} or with \var{base} set to 10, this behaves
|
||||
identical to the built-in function \code{int()} when passed a string.
|
||||
identical to the built-in function \function{int()} when passed a string.
|
||||
(Also note: for a more flexible interpretation of numeric literals,
|
||||
use the built-in function \code{eval()}.)
|
||||
\bifuncindex{eval}
|
||||
use the built-in function \function{eval()}\bifuncindex{eval}.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{atol}{s\optional{\, base}}
|
||||
\begin{funcdesc}{atol}{s\optional{, base}}
|
||||
Convert string \var{s} to a long integer in the given \var{base}. The
|
||||
string must consist of one or more digits, optionally preceded by a
|
||||
sign (\samp{+} or \samp{-}). The \var{base} argument has the same
|
||||
meaning as for \code{atoi()}. A trailing \samp{l} or \samp{L} is not
|
||||
allowed, except if the base is 0. Note that when invoked without
|
||||
meaning as for \function{atoi()}. A trailing \samp{l} or \samp{L} is
|
||||
not allowed, except if the base is 0. Note that when invoked without
|
||||
\var{base} or with \var{base} set to 10, this behaves identical to the
|
||||
built-in function \code{long()} when passed a string.
|
||||
built-in function \function{long()}\bifuncindex{long} when passed a
|
||||
string.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{capitalize}{word}
|
||||
|
@ -93,13 +93,14 @@ Capitalize the first character of the argument.
|
|||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{capwords}{s}
|
||||
Split the argument into words using \code{split}, capitalize each word
|
||||
using \code{capitalize}, and join the capitalized words using
|
||||
\code{join}. Note that this replaces runs of whitespace characters by
|
||||
a single space, and removes leading and trailing whitespace.
|
||||
Split the argument into words using \function{split()}, capitalize
|
||||
each word using \function{capitalize()}, and join the capitalized
|
||||
words using \function{join()}. Note that this replaces runs of
|
||||
whitespace characters by a single space, and removes leading and
|
||||
trailing whitespace.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{expandtabs}{s\, tabsize}
|
||||
\begin{funcdesc}{expandtabs}{s, tabsize}
|
||||
Expand tabs in a string, i.e.\ replace them by one or more spaces,
|
||||
depending on the current column and the given tab size. The column
|
||||
number is reset to zero after each newline occurring in the string.
|
||||
|
@ -107,29 +108,29 @@ This doesn't understand other non-printing characters or escape
|
|||
sequences.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{find}{s\, sub\optional{\, start\optional{\,end}}}
|
||||
\begin{funcdesc}{find}{s, sub\optional{, start\optional{,end}}}
|
||||
Return the lowest index in \var{s} where the substring \var{sub} is
|
||||
found such that \var{sub} is wholly contained in
|
||||
\code{\var{s}[\var{start}:\var{end}]}. Return -1 on failure.
|
||||
\code{\var{s}[\var{start}:\var{end}]}. Return \code{-1} on failure.
|
||||
Defaults for \var{start} and \var{end} and interpretation of negative
|
||||
values is the same as for slices.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{rfind}{s\, sub\optional{\, start\optional{\,end}}}
|
||||
Like \code{find} but find the highest index.
|
||||
\begin{funcdesc}{rfind}{s, sub\optional{, start\optional{, end}}}
|
||||
Like \function{find()} but find the highest index.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{index}{s\, sub\optional{\, start\optional{\,end}}}
|
||||
Like \code{find} but raise \code{ValueError} when the substring is
|
||||
not found.
|
||||
\begin{funcdesc}{index}{s, sub\optional{, start\optional{, end}}}
|
||||
Like \function{find()} but raise \exception{ValueError} when the
|
||||
substring is not found.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{rindex}{s\, sub\optional{\, start\optional{\,end}}}
|
||||
Like \code{rfind} but raise \code{ValueError} when the substring is
|
||||
not found.
|
||||
\begin{funcdesc}{rindex}{s, sub\optional{, start\optional{, end}}}
|
||||
Like \function{rfind()} but raise \exception{ValueError} when the
|
||||
substring is not found.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{count}{s\, sub\optional{\, start\optional{\,end}}}
|
||||
\begin{funcdesc}{count}{s, sub\optional{, start\optional{, end}}}
|
||||
Return the number of (non-overlapping) occurrences of substring
|
||||
\var{sub} in string \code{\var{s}[\var{start}:\var{end}]}.
|
||||
Defaults for \var{start} and \var{end} and interpretation of negative
|
||||
|
@ -141,13 +142,13 @@ Convert letters to lower case.
|
|||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{maketrans}{from, to}
|
||||
Return a translation table suitable for passing to \code{string.translate}
|
||||
or \code{regex.compile}, that will map each character in \var{from}
|
||||
into the character at the same position in \var{to}; \var{from} and
|
||||
\var{to} must have the same length.
|
||||
Return a translation table suitable for passing to
|
||||
\function{translate()} or \function{regex.compile()}, that will map
|
||||
each character in \var{from} into the character at the same position
|
||||
in \var{to}; \var{from} and \var{to} must have the same length.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{split}{s\optional{\, sep\optional{\, maxsplit}}}
|
||||
\begin{funcdesc}{split}{s\optional{, sep\optional{, maxsplit}}}
|
||||
Return a list of the words of the string \var{s}. If the optional
|
||||
second argument \var{sep} is absent or \code{None}, the words are
|
||||
separated by arbitrary strings of whitespace characters (space, tab,
|
||||
|
@ -161,24 +162,24 @@ remainder of the string is returned as the final element of the list
|
|||
(thus, the list will have at most \code{\var{maxsplit}+1} elements).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{splitfields}{s\optional{\, sep\optional{\, maxsplit}}}
|
||||
This function behaves identically to \code{split}. (In the past,
|
||||
\code{split} was only used with one argument, while \code{splitfields}
|
||||
was only used with two arguments.)
|
||||
\begin{funcdesc}{splitfields}{s\optional{, sep\optional{, maxsplit}}}
|
||||
This function behaves identically to \function{split()}. (In the
|
||||
past, \function{split()} was only used with one argument, while
|
||||
\function{splitfields()} was only used with two arguments.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{join}{words\optional{\, sep}}
|
||||
\begin{funcdesc}{join}{words\optional{, sep}}
|
||||
Concatenate a list or tuple of words with intervening occurrences of
|
||||
\var{sep}. The default value for \var{sep} is a single space character.
|
||||
It is always true that
|
||||
\code{string.join(string.split(\var{s}, \var{sep}), \var{sep})}
|
||||
\var{sep}. The default value for \var{sep} is a single space
|
||||
character. It is always true that
|
||||
\samp{string.join(string.split(\var{s}, \var{sep}), \var{sep})}
|
||||
equals \var{s}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{joinfields}{words\optional{\, sep}}
|
||||
This function behaves identical to \code{join}. (In the past,
|
||||
\code{join} was only used with one argument, while \code{joinfields}
|
||||
was only used with two arguments.)
|
||||
\begin{funcdesc}{joinfields}{words\optional{, sep}}
|
||||
This function behaves identical to \function{join()}. (In the past,
|
||||
\function{join()} was only used with one argument, while
|
||||
\function{joinfields()} was only used with two arguments.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lstrip}{s}
|
||||
|
@ -198,19 +199,19 @@ Convert lower case letters to upper case and vice versa.
|
|||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{translate}{s, table\optional{, deletechars}}
|
||||
Delete all characters from \var{s} that are in \var{deletechars} (if present), and
|
||||
then translate the characters using \var{table}, which must be
|
||||
a 256-character string giving the translation for each character
|
||||
value, indexed by its ordinal.
|
||||
Delete all characters from \var{s} that are in \var{deletechars} (if
|
||||
present), and then translate the characters using \var{table}, which
|
||||
must be a 256-character string giving the translation for each
|
||||
character value, indexed by its ordinal.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{upper}{s}
|
||||
Convert letters to upper case.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ljust}{s\, width}
|
||||
\funcline{rjust}{s\, width}
|
||||
\funcline{center}{s\, width}
|
||||
\begin{funcdesc}{ljust}{s, width}
|
||||
\funcline{rjust}{s, width}
|
||||
\funcline{center}{s, width}
|
||||
These functions respectively left-justify, right-justify and center a
|
||||
string in a field of given width.
|
||||
They return a string that is at least
|
||||
|
@ -221,7 +222,7 @@ with spaces until the given width on the right, left or both sides.
|
|||
The string is never truncated.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{zfill}{s\, width}
|
||||
\begin{funcdesc}{zfill}{s, width}
|
||||
Pad a numeric string on the left with zero digits until the given
|
||||
width is reached. Strings starting with a sign are handled correctly.
|
||||
\end{funcdesc}
|
||||
|
@ -234,10 +235,10 @@ replaced.
|
|||
\end{funcdesc}
|
||||
|
||||
This module is implemented in Python. Much of its functionality has
|
||||
been reimplemented in the built-in module \code{strop}. However, you
|
||||
been reimplemented in the built-in module
|
||||
\module{strop}\refbimodindex{strop}. However, you
|
||||
should \emph{never} import the latter module directly. When
|
||||
\code{string} discovers that \code{strop} exists, it transparently
|
||||
replaces parts of itself with the implementation from \code{strop}.
|
||||
\module{string} discovers that \module{strop} exists, it transparently
|
||||
replaces parts of itself with the implementation from \module{strop}.
|
||||
After initialization, there is \emph{no} overhead in using
|
||||
\code{string} instead of \code{strop}.
|
||||
\refbimodindex{strop}
|
||||
\module{string} instead of \module{strop}.
|
||||
|
|
|
@ -16,14 +16,14 @@ The module defines the following exception and functions:
|
|||
describing what is wrong.
|
||||
\end{excdesc}
|
||||
|
||||
\begin{funcdesc}{pack}{fmt\, v1\, v2\, {\rm \ldots}}
|
||||
\begin{funcdesc}{pack}{fmt, v1, v2, {\rm \ldots}}
|
||||
Return a string containing the values
|
||||
\code{\var{v1}, \var{v2}, {\rm \ldots}} packed according to the given
|
||||
format. The arguments must match the values required by the format
|
||||
exactly.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{unpack}{fmt\, string}
|
||||
\begin{funcdesc}{unpack}{fmt, string}
|
||||
Unpack the string (presumably packed by \code{pack(\var{fmt}, {\rm \ldots})})
|
||||
according to the given format. The result is a tuple even if it
|
||||
contains exactly one item. The string must contain exactly the
|
||||
|
|
|
@ -10,7 +10,7 @@ The module defines the following functions:
|
|||
|
||||
\setindexsubitem{(in module syslog)}
|
||||
|
||||
\begin{funcdesc}{syslog}{\optional{priority\,} message}
|
||||
\begin{funcdesc}{syslog}{\optional{priority,} message}
|
||||
Send the string \var{message} to the system logger.
|
||||
A trailing newline is added if necessary.
|
||||
Each message is tagged with a priority composed of a \var{facility} and
|
||||
|
|
|
@ -61,7 +61,7 @@ The \module{spam} module defines the following functions:
|
|||
% least once in the description; each usage (even inside \code{...})
|
||||
% should be enclosed in \var{...}.
|
||||
|
||||
\begin{funcdesc}{open}{filename\optional{\, mode\, buffersize}}
|
||||
\begin{funcdesc}{open}{filename\optional{, mode, buffersize}}
|
||||
Open the file \var{filename} as a can of Spam. The optional
|
||||
\var{mode} and \var{buffersize} arguments specify the read-write mode
|
||||
(\code{'r'} (default) or \code{'w'}) and the buffer size (default:
|
||||
|
|
|
@ -25,7 +25,7 @@ It defines the following constant and functions:
|
|||
Raised on thread-specific errors.
|
||||
\end{excdesc}
|
||||
|
||||
\begin{funcdesc}{start_new_thread}{func\, arg}
|
||||
\begin{funcdesc}{start_new_thread}{func, arg}
|
||||
Start a new thread. The thread executes the function \var{func}
|
||||
with the argument list \var{arg} (which must be a tuple). When the
|
||||
function returns, the thread silently exits. When the function
|
||||
|
|
|
@ -534,9 +534,9 @@ dictionary entry.
|
|||
\indexii{dictionary}{type}
|
||||
|
||||
Dictionaries are created by placing a comma-separated list of
|
||||
\code{\var{key}:\,\var{value}} pairs within braces, for example:
|
||||
\code{\{'jack':\,4098, 'sjoerd':\,4127\}} or
|
||||
\code{\{4098:\,'jack', 4127:\,'sjoerd'\}}.
|
||||
\code{\var{key}: \var{value}} pairs within braces, for example:
|
||||
\code{\{'jack': 4098, 'sjoerd': 4127\}} or
|
||||
\code{\{4098: 'jack', 4127: 'sjoerd'\}}.
|
||||
|
||||
The following operations are defined on mappings (where \var{a} is a
|
||||
mapping, \var{k} is a key and \var{x} is an arbitrary object):
|
||||
|
@ -767,7 +767,7 @@ descriptors, e.g. module \code{fcntl} or \code{os.read()} and friends.
|
|||
internal buffer size) are read.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{seek}{offset\, whence}
|
||||
\begin{funcdesc}{seek}{offset, whence}
|
||||
Set the file's current position, like \code{stdio}'s \code{fseek()}.
|
||||
The \var{whence} argument is optional and defaults to \code{0}
|
||||
(absolute file positioning); other values are \code{1} (seek
|
||||
|
|
|
@ -55,7 +55,7 @@ Clear the cache that may have been built up by previous calls to
|
|||
\function{urlretrieve()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{quote}{string\optional{\, addsafe}}
|
||||
\begin{funcdesc}{quote}{string\optional{, addsafe}}
|
||||
Replace special characters in \var{string} using the \samp{\%xx} escape.
|
||||
Letters, digits, and the characters \character{_,.-} are never quoted.
|
||||
The optional \var{addsafe} parameter specifies additional characters
|
||||
|
@ -64,7 +64,7 @@ that should not be quoted --- its default value is \code{'/'}.
|
|||
Example: \code{quote('/\~connolly/')} yields \code{'/\%7econnolly/'}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{quote_plus}{string\optional{\, addsafe}}
|
||||
\begin{funcdesc}{quote_plus}{string\optional{, addsafe}}
|
||||
Like \function{quote()}, but also replaces spaces by plus signs, as
|
||||
required for quoting HTML form values.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -61,7 +61,7 @@ URL that was parsed originally had redundant delimiters, e.g. a ? with
|
|||
an empty query (the draft states that these are equivalent).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{urljoin}{base\, url\optional{\, allow_fragments}}
|
||||
\begin{funcdesc}{urljoin}{base, url\optional{, allow_fragments}}
|
||||
Construct a full (``absolute'') URL by combining a ``base URL''
|
||||
(\var{base}) with a ``relative URL'' (\var{url}). Informally, this
|
||||
uses components of the base URL, in particular the addressing scheme,
|
||||
|
|
|
@ -19,7 +19,7 @@ The \module{uu} module defines the following functions:
|
|||
|
||||
\setindexsubitem{(in module uu)}
|
||||
|
||||
\begin{funcdesc}{encode}{in_file\, out_file\optional{\, name\, mode}}
|
||||
\begin{funcdesc}{encode}{in_file, out_file\optional{, name, mode}}
|
||||
Uuencode file \var{in_file} into file \var{out_file}. The uuencoded
|
||||
file will have the header specifying \var{name} and \var{mode} as the
|
||||
defaults for the results of decoding the file. The default defaults
|
||||
|
@ -27,7 +27,7 @@ are taken from \var{in_file}, or \code{'-'} and \code{0666}
|
|||
respectively.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{decode}{in_file\optional{\, out_file\, mode}}
|
||||
\begin{funcdesc}{decode}{in_file\optional{, out_file, mode}}
|
||||
This call decodes uuencoded file \var{in_file} placing the result on
|
||||
file \var{out_file}. If \var{out_file} is a pathname the \var{mode} is
|
||||
also set. Defaults for \var{out_file} and \var{mode} are taken from
|
||||
|
|
|
@ -11,7 +11,7 @@ class that is also named \code{whrandom}. Instances of the
|
|||
Chooses a random element from the non-empty sequence \var{seq} and returns it.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{randint}{a\, b}
|
||||
\begin{funcdesc}{randint}{a, b}
|
||||
Returns a random integer \var{N} such that \code{\var{a}<=\var{N}<=\var{b}}.
|
||||
\end{funcdesc}
|
||||
|
||||
|
@ -19,7 +19,7 @@ Returns a random integer \var{N} such that \code{\var{a}<=\var{N}<=\var{b}}.
|
|||
Returns the next random floating point number in the range [0.0 ... 1.0).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{seed}{x\, y\, z}
|
||||
\begin{funcdesc}{seed}{x, y, z}
|
||||
Initializes the random number generator from the integers
|
||||
\var{x},
|
||||
\var{y}
|
||||
|
@ -29,7 +29,7 @@ When the module is first imported, the random number is initialized
|
|||
using values derived from the current time.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{uniform}{a\, b}
|
||||
\begin{funcdesc}{uniform}{a, b}
|
||||
Returns a random real number \var{N} such that \code{\var{a}<=\var{N}<\var{b}}.
|
||||
\end{funcdesc}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ the individual item. At the end of the list, an unsigned integer
|
|||
\code{0} is packed.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{pack_farray}{n\, array\, pack_item}
|
||||
\begin{funcdesc}{pack_farray}{n, array, pack_item}
|
||||
Packs a fixed length list (\var{array}) of homogeneous items. \var{n}
|
||||
is the length of the list; it is \emph{not} packed into the buffer,
|
||||
but a \exception{ValueError} exception is raised if
|
||||
|
@ -104,7 +104,7 @@ but a \exception{ValueError} exception is raised if
|
|||
\var{pack_item} is the function used to pack each element.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{pack_array}{list\, pack_item}
|
||||
\begin{funcdesc}{pack_array}{list, pack_item}
|
||||
Packs a variable length \var{list} of homogeneous items. First, the
|
||||
length of the list is packed as an unsigned integer, then each element
|
||||
is packed as in \method{pack_farray()} above.
|
||||
|
@ -192,7 +192,7 @@ then the item is unpacked and appended to the list. A flag of
|
|||
function that is called to unpack the items.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{unpack_farray}{n\, unpack_item}
|
||||
\begin{funcdesc}{unpack_farray}{n, unpack_item}
|
||||
Unpacks and returns (as a list) a fixed length array of homogeneous
|
||||
items. \var{n} is number of list elements to expect in the buffer.
|
||||
As above, \var{unpack_item} is the function used to unpack each element.
|
||||
|
|
|
@ -78,7 +78,7 @@ The base implementation simply calls \var{method} with \var{attributes}
|
|||
as the only argument.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{handle_endtag}{tag\, method}
|
||||
\begin{funcdesc}{handle_endtag}{tag, method}
|
||||
This method is called to handle endtags for which an
|
||||
\code{end_\var{tag}()} method has been defined. The \var{tag}
|
||||
argument is the name of the tag, and the
|
||||
|
@ -170,7 +170,7 @@ raise a \exception{RuntimeError} without first calling
|
|||
\method{syntax_error()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{unknown_starttag}{tag\, attributes}
|
||||
\begin{funcdesc}{unknown_starttag}{tag, attributes}
|
||||
This method is called to process an unknown start tag. It is intended
|
||||
to be overridden by a derived class; the base class implementation
|
||||
does nothing.
|
||||
|
|
|
@ -14,7 +14,7 @@ later version if one is available.
|
|||
The available functions in this module are:
|
||||
|
||||
\setindexsubitem{(in module zlib)}
|
||||
\begin{funcdesc}{adler32}{string\optional{\, value}}
|
||||
\begin{funcdesc}{adler32}{string\optional{, value}}
|
||||
Computes a Adler-32 checksum of \var{string}. (An Adler-32
|
||||
checksum is almost as reliable as a CRC32 but can be computed much
|
||||
more quickly.) If \var{value} is present, it is used as the
|
||||
|
@ -25,7 +25,7 @@ The available functions in this module are:
|
|||
authentication or digital signatures.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{compress}{string\optional{\, level}}
|
||||
\begin{funcdesc}{compress}{string\optional{, level}}
|
||||
Compresses the data in \var{string}, returning a string contained
|
||||
compressed data. \var{level} is an integer from \code{1} to \code{9}
|
||||
controlling the level of compression; \code{1} is fastest and produces
|
||||
|
@ -42,7 +42,7 @@ exception if any error occurs.
|
|||
produces the most. The default value is \code{6}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{crc32}{string\optional{\, value}}
|
||||
\begin{funcdesc}{crc32}{string\optional{, value}}
|
||||
Computes a CRC (Cyclic Redundancy Check) sum of \var{string}. If
|
||||
\var{value} is present, it is used as the starting value of the
|
||||
checksum; otherwise, a fixed default value is used. This allows
|
||||
|
|
|
@ -24,7 +24,7 @@ second's worth occupies 2*2*44100 bytes, i.e.\ 176,400 bytes.
|
|||
Module \code{aifc} defines the following function:
|
||||
|
||||
\setindexsubitem{(in module aifc)}
|
||||
\begin{funcdesc}{open}{file\, mode}
|
||||
\begin{funcdesc}{open}{file, mode}
|
||||
Open an AIFF or AIFF-C file and return an object instance with
|
||||
methods that are described below. The argument file is either a
|
||||
string naming a file or a file object. The mode is either the string
|
||||
|
@ -146,7 +146,7 @@ If this parameter is not set, or not set correctly, the file needs to
|
|||
support seeking.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setcomptype}{type\, name}
|
||||
\begin{funcdesc}{setcomptype}{type, name}
|
||||
Specify the compression type. If not specified, the audio data will
|
||||
not be compressed. In AIFF files, compression is not possible. The
|
||||
name parameter should be a human-readable description of the
|
||||
|
@ -155,14 +155,14 @@ string. Currently the following compression types are supported:
|
|||
NONE, ULAW, ALAW, G722.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setparams}{nchannels\, sampwidth\, framerate\, comptype\, compname}
|
||||
\begin{funcdesc}{setparams}{nchannels, sampwidth, framerate, comptype, compname}
|
||||
Set all the above parameters at once. The argument is a tuple
|
||||
consisting of the various parameters. This means that it is possible
|
||||
to use the result of a \code{getparams()} call as argument to
|
||||
\code{setparams()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setmark}{id\, pos\, name}
|
||||
\begin{funcdesc}{setmark}{id, pos, name}
|
||||
Add a mark with the given id (larger than 0), and the given name at
|
||||
the given position. This method can be called at any time before
|
||||
\code{close()}.
|
||||
|
|
|
@ -27,7 +27,7 @@ The module defines the following functions:
|
|||
|
||||
\setindexsubitem{(in module al)}
|
||||
|
||||
\begin{funcdesc}{openport}{name\, direction\optional{\, config}}
|
||||
\begin{funcdesc}{openport}{name, direction\optional{, config}}
|
||||
The name and direction arguments are strings. The optional config
|
||||
argument is a configuration object as returned by
|
||||
\code{al.newconfig()}. The return value is an \dfn{port object};
|
||||
|
@ -44,12 +44,12 @@ The device argument is an integer. The return value is a list of
|
|||
integers containing the data returned by ALqueryparams().
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{getparams}{device\, list}
|
||||
\begin{funcdesc}{getparams}{device, list}
|
||||
The device argument is an integer. The list argument is a list such
|
||||
as returned by \code{queryparams}; it is modified in place (!).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setparams}{device\, list}
|
||||
\begin{funcdesc}{setparams}{device, list}
|
||||
The device argument is an integer. The list argument is a list such
|
||||
as returned by \code{al.queryparams}.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -12,7 +12,7 @@ the exception \code{amoeba.error = 'amoeba.error'}.
|
|||
The module \code{amoeba} defines the following items:
|
||||
|
||||
\setindexsubitem{(in module amoeba)}
|
||||
\begin{funcdesc}{name_append}{path\, cap}
|
||||
\begin{funcdesc}{name_append}{path, cap}
|
||||
Stores a capability in the Amoeba directory tree.
|
||||
Arguments are the pathname (a string) and the capability (a capability
|
||||
object as returned by
|
||||
|
@ -32,7 +32,7 @@ Returns a
|
|||
object, to which various interesting operations apply, described below.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{name_replace}{path\, cap}
|
||||
\begin{funcdesc}{name_replace}{path, cap}
|
||||
Replaces a capability in the Amoeba directory tree.
|
||||
Arguments are the pathname and the new capability.
|
||||
(This differs from
|
||||
|
@ -91,7 +91,7 @@ The following methods are defined for capability objects.
|
|||
Returns a list of the names of the entries in an Amoeba directory.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{b_read}{offset\, maxsize}
|
||||
\begin{funcdesc}{b_read}{offset, maxsize}
|
||||
Reads (at most)
|
||||
\var{maxsize}
|
||||
bytes from a bullet file at offset
|
||||
|
|
|
@ -13,7 +13,7 @@ will be used. Both modules provide the same interface:
|
|||
% at the same time.
|
||||
\setindexsubitem{(in modules anydbm, dumbdbm)}
|
||||
|
||||
\begin{funcdesc}{open}{filename\optional{\, flag\, mode}}
|
||||
\begin{funcdesc}{open}{filename\optional{, flag, mode}}
|
||||
Open the database file \var{filename} and return a corresponding object.
|
||||
The optional \var{flag} argument can be
|
||||
\code{'r'} to open an existing database for reading only,
|
||||
|
|
|
@ -35,7 +35,7 @@ See also built-in module \module{struct}\refbimodindex{struct}.
|
|||
|
||||
The module defines the following function:
|
||||
|
||||
\begin{funcdesc}{array}{typecode\optional{\, initializer}}
|
||||
\begin{funcdesc}{array}{typecode\optional{, initializer}}
|
||||
Return a new array whose items are restricted by \var{typecode}, and
|
||||
initialized from the optional \var{initializer} value, which must be a
|
||||
list or a string. The list or string is passed to the new array's
|
||||
|
@ -77,7 +77,7 @@ integer values. It is useful when reading data from a file written
|
|||
on a machine with a different byte order.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{fromfile}{f\, n}
|
||||
\begin{funcdesc}{fromfile}{f, n}
|
||||
Read \var{n} items (as machine values) from the file object \var{f}
|
||||
and append them to the end of the array. If less than \var{n} items
|
||||
are available, \exception{EOFError} is raised, but the items that were
|
||||
|
@ -98,12 +98,12 @@ array of machine values (i.e. as if it had been read from a
|
|||
file using the \method{fromfile()} method).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{insert}{i\, x}
|
||||
\begin{funcdesc}{insert}{i, x}
|
||||
Insert a new item with value \var{x} in the array before position
|
||||
\var{i}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{read}{f\, n}
|
||||
\begin{funcdesc}{read}{f, n}
|
||||
\deprecated {1.5.1}
|
||||
{Use the \method{fromfile()} method.}
|
||||
Read \var{n} items (as machine values) from the file object \var{f}
|
||||
|
|
|
@ -19,46 +19,46 @@ This exception is raised on all errors, such as unknown number of bytes
|
|||
per sample, etc.
|
||||
\end{excdesc}
|
||||
|
||||
\begin{funcdesc}{add}{fragment1\, fragment2\, width}
|
||||
\begin{funcdesc}{add}{fragment1, fragment2, width}
|
||||
Return a fragment which is the addition of the two samples passed as
|
||||
parameters. \var{width} is the sample width in bytes, either
|
||||
\code{1}, \code{2} or \code{4}. Both fragments should have the same
|
||||
length.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{adpcm2lin}{adpcmfragment\, width\, state}
|
||||
\begin{funcdesc}{adpcm2lin}{adpcmfragment, width, state}
|
||||
Decode an Intel/DVI ADPCM coded fragment to a linear fragment. See
|
||||
the description of \code{lin2adpcm} for details on ADPCM coding.
|
||||
Return a tuple \code{(\var{sample}, \var{newstate})} where the sample
|
||||
has the width specified in \var{width}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{adpcm32lin}{adpcmfragment\, width\, state}
|
||||
\begin{funcdesc}{adpcm32lin}{adpcmfragment, width, state}
|
||||
Decode an alternative 3-bit ADPCM code. See \code{lin2adpcm3} for
|
||||
details.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{avg}{fragment\, width}
|
||||
\begin{funcdesc}{avg}{fragment, width}
|
||||
Return the average over all samples in the fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{avgpp}{fragment\, width}
|
||||
\begin{funcdesc}{avgpp}{fragment, width}
|
||||
Return the average peak-peak value over all samples in the fragment.
|
||||
No filtering is done, so the usefulness of this routine is
|
||||
questionable.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{bias}{fragment\, width\, bias}
|
||||
\begin{funcdesc}{bias}{fragment, width, bias}
|
||||
Return a fragment that is the original fragment with a bias added to
|
||||
each sample.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{cross}{fragment\, width}
|
||||
\begin{funcdesc}{cross}{fragment, width}
|
||||
Return the number of zero crossings in the fragment passed as an
|
||||
argument.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{findfactor}{fragment\, reference}
|
||||
\begin{funcdesc}{findfactor}{fragment, reference}
|
||||
Return a factor \var{F} such that
|
||||
\code{rms(add(fragment, mul(reference, -F)))} is minimal, i.e.,
|
||||
return the factor with which you should multiply \var{reference} to
|
||||
|
@ -68,7 +68,7 @@ should both contain 2-byte samples.
|
|||
The time taken by this routine is proportional to \code{len(fragment)}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{findfit}{fragment\, reference}
|
||||
\begin{funcdesc}{findfit}{fragment, reference}
|
||||
This routine (which only accepts 2-byte sample fragments)
|
||||
|
||||
Try to match \var{reference} as well as possible to a portion of
|
||||
|
@ -82,7 +82,7 @@ and \var{factor} is the (floating-point) factor as per
|
|||
\code{findfactor}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{findmax}{fragment\, length}
|
||||
\begin{funcdesc}{findmax}{fragment, length}
|
||||
Search \var{fragment} for a slice of length \var{length} samples (not
|
||||
bytes!)\ with maximum energy, i.e., return \var{i} for which
|
||||
\code{rms(fragment[i*2:(i+length)*2])} is maximal. The fragments
|
||||
|
@ -91,15 +91,15 @@ should both contain 2-byte samples.
|
|||
The routine takes time proportional to \code{len(fragment)}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{getsample}{fragment\, width\, index}
|
||||
\begin{funcdesc}{getsample}{fragment, width, index}
|
||||
Return the value of sample \var{index} from the fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lin2lin}{fragment\, width\, newwidth}
|
||||
\begin{funcdesc}{lin2lin}{fragment, width, newwidth}
|
||||
Convert samples between 1-, 2- and 4-byte formats.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lin2adpcm}{fragment\, width\, state}
|
||||
\begin{funcdesc}{lin2adpcm}{fragment, width, state}
|
||||
Convert samples to 4 bit Intel/DVI ADPCM encoding. ADPCM coding is an
|
||||
adaptive coding scheme, whereby each 4 bit number is the difference
|
||||
between one sample and the next, divided by a (varying) step. The
|
||||
|
@ -113,41 +113,41 @@ initial call \code{None} can be passed as the state. \var{adpcmfrag}
|
|||
is the ADPCM coded fragment packed 2 4-bit values per byte.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lin2adpcm3}{fragment\, width\, state}
|
||||
\begin{funcdesc}{lin2adpcm3}{fragment, width, state}
|
||||
This is an alternative ADPCM coder that uses only 3 bits per sample.
|
||||
It is not compatible with the Intel/DVI ADPCM coder and its output is
|
||||
not packed (due to laziness on the side of the author). Its use is
|
||||
discouraged.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lin2ulaw}{fragment\, width}
|
||||
\begin{funcdesc}{lin2ulaw}{fragment, width}
|
||||
Convert samples in the audio fragment to U-LAW encoding and return
|
||||
this as a Python string. U-LAW is an audio encoding format whereby
|
||||
you get a dynamic range of about 14 bits using only 8 bit samples. It
|
||||
is used by the Sun audio hardware, among others.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{minmax}{fragment\, width}
|
||||
\begin{funcdesc}{minmax}{fragment, width}
|
||||
Return a tuple consisting of the minimum and maximum values of all
|
||||
samples in the sound fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{max}{fragment\, width}
|
||||
\begin{funcdesc}{max}{fragment, width}
|
||||
Return the maximum of the \emph{absolute value} of all samples in a
|
||||
fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{maxpp}{fragment\, width}
|
||||
\begin{funcdesc}{maxpp}{fragment, width}
|
||||
Return the maximum peak-peak value in the sound fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mul}{fragment\, width\, factor}
|
||||
\begin{funcdesc}{mul}{fragment, width, factor}
|
||||
Return a fragment that has all samples in the original framgent
|
||||
multiplied by the floating-point value \var{factor}. Overflow is
|
||||
silently ignored.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ratecv}{fragment\, width\, nchannels\, inrate\, outrate\, state\optional{\, weightA\, weightB}}
|
||||
\begin{funcdesc}{ratecv}{fragment, width, nchannels, inrate, outrate, state\optional{, weightA, weightB}}
|
||||
Convert the frame rate of the input fragment.
|
||||
|
||||
\code{State} is a tuple containing the state of the converter. The
|
||||
|
@ -158,11 +158,11 @@ The \code{weightA} and \code{weightB} arguments are parameters for a
|
|||
simple digital filter and default to 1 and 0 respectively.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{reverse}{fragment\, width}
|
||||
\begin{funcdesc}{reverse}{fragment, width}
|
||||
Reverse the samples in a fragment and returns the modified fragment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{rms}{fragment\, width}
|
||||
\begin{funcdesc}{rms}{fragment, width}
|
||||
Return the root-mean-square of the fragment, i.e.
|
||||
\iftexi
|
||||
the square root of the quotient of the sum of all squared sample value,
|
||||
|
@ -177,20 +177,20 @@ divided by the sumber of samples.
|
|||
This is a measure of the power in an audio signal.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{tomono}{fragment\, width\, lfactor\, rfactor}
|
||||
\begin{funcdesc}{tomono}{fragment, width, lfactor, rfactor}
|
||||
Convert a stereo fragment to a mono fragment. The left channel is
|
||||
multiplied by \var{lfactor} and the right channel by \var{rfactor}
|
||||
before adding the two channels to give a mono signal.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{tostereo}{fragment\, width\, lfactor\, rfactor}
|
||||
\begin{funcdesc}{tostereo}{fragment, width, lfactor, rfactor}
|
||||
Generate a stereo fragment from a mono fragment. Each pair of samples
|
||||
in the stereo fragment are computed from the mono sample, whereby left
|
||||
channel samples are multiplied by \var{lfactor} and right channel
|
||||
samples by \var{rfactor}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ulaw2lin}{fragment\, width}
|
||||
\begin{funcdesc}{ulaw2lin}{fragment, width}
|
||||
Convert sound fragments in ULAW encoding to linearly encoded sound
|
||||
fragments. ULAW encoding always uses 8 bits samples, so \var{width}
|
||||
refers only to the sample width of the output fragment here.
|
||||
|
|
|
@ -157,7 +157,7 @@ followed by text composed using the \member{error_message_format}
|
|||
class variable.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{send_response}{code\optional{\, message}}
|
||||
\begin{funcdesc}{send_response}{code\optional{, message}}
|
||||
Sends a response header and logs the accepted request. The HTTP
|
||||
response line is sent, followed by \emph{Server} and \emph{Date}
|
||||
headers. The values for these two headers are picked up from the
|
||||
|
@ -165,7 +165,7 @@ headers. The values for these two headers are picked up from the
|
|||
respectively.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{send_header}{keyword\, value}
|
||||
\begin{funcdesc}{send_header}{keyword, value}
|
||||
Writes a specific MIME header to the output stream. \var{keyword}
|
||||
should specify the header keyword, with \var{value} specifying
|
||||
its value.
|
||||
|
@ -176,7 +176,7 @@ Sends a blank line, indicating the end of the MIME headers in
|
|||
the response.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{log_request}{\optional{code\optional{\, size}}}
|
||||
\begin{funcdesc}{log_request}{\optional{code\optional{, size}}}
|
||||
Logs an accepted (successful) request. \var{code} should specify
|
||||
the numeric HTTP code associated with the response. If a size of
|
||||
the response is available, then it should be passed as the
|
||||
|
|
|
@ -17,7 +17,7 @@ other, unsafe attributes.
|
|||
|
||||
% I've punted on the issue of documenting keyword arguments for now.
|
||||
|
||||
\begin{funcdesc}{Bastion}{object\optional{\, filter\, name\, class}}
|
||||
\begin{funcdesc}{Bastion}{object\optional{, filter, name, class}}
|
||||
Protect the object \var{object}, returning a bastion for the
|
||||
object. Any attempt to access one of the object's attributes will
|
||||
have to be approved by the \var{filter} function; if the access is
|
||||
|
|
|
@ -11,14 +11,14 @@ The \code{binhex} module defines the following functions:
|
|||
|
||||
\setindexsubitem{(in module binhex)}
|
||||
|
||||
\begin{funcdesc}{binhex}{input\, output}
|
||||
\begin{funcdesc}{binhex}{input, output}
|
||||
Convert a binary file with filename \var{input} to binhex file
|
||||
\var{output}. The \var{output} parameter can either be a filename or a
|
||||
file-like object (any object supporting a \var{write} and \var{close}
|
||||
method).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{hexbin}{input\optional{\, output}}
|
||||
\begin{funcdesc}{hexbin}{input\optional{, output}}
|
||||
Decode a binhex file \var{input}. \var{input} may be a filename or a
|
||||
file-like object supporting \var{read} and \var{close} methods.
|
||||
The resulting file is written to a file named \var{output}, unless the
|
||||
|
|
|
@ -191,7 +191,7 @@ Parse a query string given as a string argument (data of type
|
|||
\mimetype{application/x-www-form-urlencoded}).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{parse_multipart}{fp\, pdict}
|
||||
\begin{funcdesc}{parse_multipart}{fp, pdict}
|
||||
Parse input of type \mimetype{multipart/form-data} (for
|
||||
file uploads). Arguments are \var{fp} for the input file and
|
||||
\var{pdict} for the dictionary containing other parameters of
|
||||
|
@ -236,7 +236,7 @@ Print a list of useful (used by CGI) environment variables in
|
|||
HTML.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{escape}{s\optional{\, quote}}
|
||||
\begin{funcdesc}{escape}{s\optional{, quote}}
|
||||
Convert the characters
|
||||
\character{\&}, \character{<} and \character{>} in string \var{s} to
|
||||
HTML-safe sequences. Use this if you need to display text that might
|
||||
|
|
|
@ -10,7 +10,7 @@ attempting to crack \UNIX{} passwords with a dictionary.
|
|||
\index{crypt(3)}
|
||||
|
||||
\setindexsubitem{(in module crypt)}
|
||||
\begin{funcdesc}{crypt}{word\, salt}
|
||||
\begin{funcdesc}{crypt}{word, salt}
|
||||
\var{word} will usually be a user's password. \var{salt} is a
|
||||
2-character string which will be used to select one of 4096 variations
|
||||
of DES\indexii{cipher}{DES}. The characters in \var{salt} must be
|
||||
|
|
|
@ -34,7 +34,7 @@ Bits in the status as returned by \var{Status}.
|
|||
Return 1 if the communication toolbox is available, zero otherwise.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{CMNew}{name\, sizes}
|
||||
\begin{funcdesc}{CMNew}{name, sizes}
|
||||
Create a connection object using the connection tool named
|
||||
\var{name}. \var{sizes} is a 6-tuple given buffer sizes for data in,
|
||||
data out, control in, control out, attention in and attention out.
|
||||
|
@ -77,21 +77,21 @@ Accept (when \var{yesno} is non-zero) or reject an incoming call after
|
|||
\var{Listen} returned.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{Close}{timeout\, now}
|
||||
\begin{funcdesc}{Close}{timeout, now}
|
||||
Close a connection. When \var{now} is zero, the close is orderly
|
||||
(i.e.\ outstanding output is flushed, etc.)\ with a timeout of
|
||||
\var{timeout} seconds. When \var{now} is non-zero the close is
|
||||
immediate, discarding output.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{Read}{len\, chan\, timeout}
|
||||
\begin{funcdesc}{Read}{len, chan, timeout}
|
||||
Read \var{len} bytes, or until \var{timeout} seconds have passed, from
|
||||
the channel \var{chan} (which is one of \var{cmData}, \var{cmCntl} or
|
||||
\var{cmAttn}). Return a 2-tuple:\ the data read and the end-of-message
|
||||
flag.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{Write}{buf\, chan\, timeout\, eom}
|
||||
\begin{funcdesc}{Write}{buf, chan, timeout, eom}
|
||||
Write \var{buf} to channel \var{chan}, aborting after \var{timeout}
|
||||
seconds. When \var{eom} has the value \var{cmFlagsEOM} an
|
||||
end-of-message indicator will be written after the data (if this
|
||||
|
|
|
@ -20,7 +20,7 @@ Raised on dbm-specific errors, such as I/O errors. \code{KeyError} is
|
|||
raised for general mapping errors like specifying an incorrect key.
|
||||
\end{excdesc}
|
||||
|
||||
\begin{funcdesc}{open}{filename\, \optional{flag\, \optional{mode}}}
|
||||
\begin{funcdesc}{open}{filename, \optional{flag, \optional{mode}}}
|
||||
Open a dbm database and return a dbm object. The \var{filename}
|
||||
argument is the name of the database file (without the \file{.dir} or
|
||||
\file{.pag} extensions).
|
||||
|
|
|
@ -49,7 +49,7 @@ traceback if none was passed. The instruction causing the exception
|
|||
is indicated.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{disassemble}{code\optional{\, lasti}}
|
||||
\begin{funcdesc}{disassemble}{code\optional{, lasti}}
|
||||
Disassembles a code object, indicating the last instruction if \var{lasti}
|
||||
was provided. The output is divided in the following columns:
|
||||
\begin{itemize}
|
||||
|
@ -65,7 +65,7 @@ variable names, constant values, branch targets, and compare
|
|||
operators.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{disco}{code\optional{\, lasti}}
|
||||
\begin{funcdesc}{disco}{code\optional{, lasti}}
|
||||
A synonym for disassemble. It is more convenient to type, and kept
|
||||
for compatibility with earlier Python releases.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -66,7 +66,7 @@ Add a hard line break if one does not already exist. This does not
|
|||
break the logical paragraph.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{add_hor_rule}{*args\, **kw}
|
||||
\begin{funcdesc}{add_hor_rule}{*args, **kw}
|
||||
Insert a horizontal rule in the output. A hard break is inserted if
|
||||
there is data in the current paragraph, but the logical paragraph is
|
||||
not broken. The arguments and keywords are passed on to the writer's
|
||||
|
@ -268,7 +268,7 @@ lines, or the equivelent. The \var{blankline} value will be an
|
|||
integer.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{send_hor_rule}{*args\, **kw}
|
||||
\begin{funcdesc}{send_hor_rule}{*args, **kw}
|
||||
Display a horizontal rule on the output device. The arguments to this
|
||||
method are entirely application- and writer-specific, and should be
|
||||
interpreted with care. The method implementation may assume that a
|
||||
|
@ -317,7 +317,7 @@ else. Each method simply announces itself by printing its name and
|
|||
arguments on standard output.
|
||||
\end{classdesc}
|
||||
|
||||
\begin{classdesc}{DumbWriter}{\optional{file\optional{\, maxcol\code{ = 72}}}}
|
||||
\begin{classdesc}{DumbWriter}{\optional{file\optional{, maxcol\code{ = 72}}}}
|
||||
Simple writer class which writes output on the file object passed in
|
||||
as \var{file} or, if \var{file} is omitted, on standard output. The
|
||||
output is simply word-wrapped to the number of columns specified by
|
||||
|
|
|
@ -31,14 +31,14 @@ An object representing the menubar. This object is usually not created
|
|||
by the user.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{Menu}{bar\, title\optional{\, after}}
|
||||
\begin{funcdesc}{Menu}{bar, title\optional{, after}}
|
||||
An object representing a menu. Upon creation you pass the
|
||||
\code{MenuBar} the menu appears in, the \var{title} string and a
|
||||
position (1-based) \var{after} where the menu should appear (default:
|
||||
at the end).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{MenuItem}{menu\, title\optional{\, shortcut\, callback}}
|
||||
\begin{funcdesc}{MenuItem}{menu, title\optional{, shortcut, callback}}
|
||||
Create a menu item object. The arguments are the menu to crate the
|
||||
item it, the item title string and optionally the keyboard shortcut
|
||||
and a callback routine. The callback is called with the arguments
|
||||
|
@ -58,7 +58,7 @@ correct dimming for all menu items based on the current front window.
|
|||
Add a separator to the end of a menu.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{SubMenu}{menu\, label}
|
||||
\begin{funcdesc}{SubMenu}{menu, label}
|
||||
Create a submenu named \var{label} under menu \var{menu}. The menu
|
||||
object is returned.
|
||||
\end{funcdesc}
|
||||
|
@ -72,7 +72,7 @@ which the window belongs. The window is not displayed until later.
|
|||
Creates a modeless dialog window.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{windowbounds}{width\, height}
|
||||
\begin{funcdesc}{windowbounds}{width, height}
|
||||
Return a \code{(left, top, right, bottom)} tuple suitable for creation
|
||||
of a window of given width and height. The window will be staggered
|
||||
with respect to previous windows, and an attempt is made to keep the
|
||||
|
@ -104,7 +104,7 @@ application. Alternatively, override the \code{do_about} method for
|
|||
more elaborate about messages.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mainloop}{\optional{mask\, wait}}
|
||||
\begin{funcdesc}{mainloop}{\optional{mask, wait}}
|
||||
This routine is the main event loop, call it to set your application
|
||||
rolling. \var{Mask} is the mask of events you want to handle,
|
||||
\var{wait} is the number of ticks you want to leave to other
|
||||
|
@ -145,7 +145,7 @@ The old on/off value is returned.
|
|||
Terminate the event \code{mainloop} at the next convenient moment.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_char}{c\, event}
|
||||
\begin{funcdesc}{do_char}{c, event}
|
||||
The user typed character \var{c}. The complete details of the event
|
||||
can be found in the \var{event} structure. This method can also be
|
||||
provided in a \code{Window} object, which overrides the
|
||||
|
@ -181,22 +181,22 @@ Override this method to do any special processing on window
|
|||
close. Call \code{self.do_postclose} to cleanup the parent state.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_postresize}{width\, height\, macoswindowid}
|
||||
\begin{funcdesc}{do_postresize}{width, height, macoswindowid}
|
||||
Called after the window is resized. Override if more needs to be done
|
||||
than calling \code{InvalRect}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_contentclick}{local\, modifiers\, event}
|
||||
\begin{funcdesc}{do_contentclick}{local, modifiers, event}
|
||||
The user clicked in the content part of a window. The arguments are
|
||||
the coordinates (window-relative), the key modifiers and the raw
|
||||
event.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_update}{macoswindowid\, event}
|
||||
\begin{funcdesc}{do_update}{macoswindowid, event}
|
||||
An update event for the window was received. Redraw the window.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_activate}{activate\, event}
|
||||
\begin{funcdesc}{do_activate}{activate, event}
|
||||
The window was activated (\code{activate==1}) or deactivated
|
||||
(\code{activate==0}). Handle things like focus highlighting, etc.
|
||||
\end{funcdesc}
|
||||
|
@ -208,7 +208,7 @@ ControlsWindow objects have the following methods besides those of
|
|||
|
||||
\setindexsubitem{(ControlsWindow method)}
|
||||
|
||||
\begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event}
|
||||
\begin{funcdesc}{do_controlhit}{window, control, pcode, event}
|
||||
Part \code{pcode} of control \code{control} was hit by the
|
||||
user. Tracking and such has already been taken care of.
|
||||
\end{funcdesc}
|
||||
|
@ -220,7 +220,7 @@ extra methods:
|
|||
|
||||
\setindexsubitem{(ScrolledWindow method)}
|
||||
|
||||
\begin{funcdesc}{scrollbars}{\optional{wantx\, wanty}}
|
||||
\begin{funcdesc}{scrollbars}{\optional{wantx, wanty}}
|
||||
Create (or destroy) horizontal and vertical scrollbars. The arguments
|
||||
specify which you want (default: both). The scrollbars always have
|
||||
minimum \code{0} and maximum \code{32767}.
|
||||
|
@ -238,32 +238,32 @@ Call this method when the document has changed. It will call
|
|||
\code{getscrollbarvalues} and update the scrollbars.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{scrollbar_callback}{which\, what\, value}
|
||||
\begin{funcdesc}{scrollbar_callback}{which, what, value}
|
||||
Supplied by you and called after user interaction. \code{Which} will
|
||||
be \code{'x'} or \code{'y'}, \code{what} will be \code{'-'},
|
||||
\code{'--'}, \code{'set'}, \code{'++'} or \code{'+'}. For
|
||||
\code{'set'}, \code{value} will contain the new scrollbar position.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{scalebarvalues}{absmin\, absmax\, curmin\, curmax}
|
||||
\begin{funcdesc}{scalebarvalues}{absmin, absmax, curmin, curmax}
|
||||
Auxiliary method to help you calculate values to return from
|
||||
\code{getscrollbarvalues}. You pass document minimum and maximum value
|
||||
and topmost (leftmost) and bottommost (rightmost) visible values and
|
||||
it returns the correct number or \code{None}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_activate}{onoff\, event}
|
||||
\begin{funcdesc}{do_activate}{onoff, event}
|
||||
Takes care of dimming/highlighting scrollbars when a window becomes
|
||||
frontmost vv. If you override this method call this one at the end of
|
||||
your method.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_postresize}{width\, height\, window}
|
||||
\begin{funcdesc}{do_postresize}{width, height, window}
|
||||
Moves scrollbars to the correct position. Call this method initially
|
||||
if you override it.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event}
|
||||
\begin{funcdesc}{do_controlhit}{window, control, pcode, event}
|
||||
Handles scrollbar interaction. If you override it call this method
|
||||
first, a nonzero return value indicates the hit was in the scrollbars
|
||||
and has been handled.
|
||||
|
@ -281,7 +281,7 @@ Create the dialog window, from the DLOG resource with id
|
|||
\var{resid}. The dialog object is stored in \code{self.wid}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{do_itemhit}{item\, event}
|
||||
\begin{funcdesc}{do_itemhit}{item, event}
|
||||
Item number \var{item} was hit. You are responsible for redrawing
|
||||
toggle buttons, etc.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -54,7 +54,7 @@ find the \code{eggs} variable.
|
|||
complex number, its magnitude is returned.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{apply}{function\, args\optional{, keywords}}
|
||||
\begin{funcdesc}{apply}{function, args\optional{, keywords}}
|
||||
The \var{function} argument must be a callable object (a user-defined or
|
||||
built-in function or method, or a class object) and the \var{args}
|
||||
argument must be a tuple. The \var{function} is called with
|
||||
|
@ -82,20 +82,20 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
inclusive.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{cmp}{x\, y}
|
||||
\begin{funcdesc}{cmp}{x, y}
|
||||
Compare the two objects \var{x} and \var{y} and return an integer
|
||||
according to the outcome. The return value is negative if \code{\var{x}
|
||||
< \var{y}}, zero if \code{\var{x} == \var{y}} and strictly positive if
|
||||
\code{\var{x} > \var{y}}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{coerce}{x\, y}
|
||||
\begin{funcdesc}{coerce}{x, y}
|
||||
Return a tuple consisting of the two numeric arguments converted to
|
||||
a common type, using the same rules as used by arithmetic
|
||||
operations.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{compile}{string\, filename\, kind}
|
||||
\begin{funcdesc}{compile}{string, filename, kind}
|
||||
Compile the \var{string} into a code object. Code objects can be
|
||||
executed by an \keyword{exec} statement or evaluated by a call to
|
||||
\function{eval()}. The \var{filename} argument should
|
||||
|
@ -117,7 +117,7 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
\function{long()} and \function{float()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{delattr}{object\, name}
|
||||
\begin{funcdesc}{delattr}{object, name}
|
||||
This is a relative of \function{setattr()}. The arguments are an
|
||||
object and a string. The string must be the name
|
||||
of one of the object's attributes. The function deletes
|
||||
|
@ -146,7 +146,7 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
\end{verbatim}
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{divmod}{a\, b}
|
||||
\begin{funcdesc}{divmod}{a, b}
|
||||
Take two numbers as arguments and return a pair of numbers consisting
|
||||
of their quotient and remainder when using long division. With mixed
|
||||
operand types, the rules for binary arithmetic operators apply. For
|
||||
|
@ -156,7 +156,7 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
\code{(math.floor(\var{a} / \var{b}), \var{a} \%{} \var{b})}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{eval}{expression\optional{\, globals\optional{\, locals}}}
|
||||
\begin{funcdesc}{eval}{expression\optional{, globals\optional{, locals}}}
|
||||
The arguments are a string and two optional dictionaries. The
|
||||
\var{expression} argument is parsed and evaluated as a Python
|
||||
expression (technically speaking, a condition list) using the
|
||||
|
@ -188,7 +188,7 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
\function{execfile()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{execfile}{file\optional{\, globals\optional{\, locals}}}
|
||||
\begin{funcdesc}{execfile}{file\optional{, globals\optional{, locals}}}
|
||||
This function is similar to the
|
||||
\keyword{exec} statement, but parses a file instead of a string. It
|
||||
is different from the \keyword{import} statement in that it does not
|
||||
|
@ -206,7 +206,7 @@ class instances are callable if they have a \method{__call__()} method.
|
|||
\code{None}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{filter}{function\, list}
|
||||
\begin{funcdesc}{filter}{function, list}
|
||||
Construct a list from those elements of \var{list} for which
|
||||
\var{function} returns true. If \var{list} is a string or a tuple,
|
||||
the result also has that type; otherwise it is always a list. If
|
||||
|
@ -226,7 +226,7 @@ removed.
|
|||
returned.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{getattr}{object\, name}
|
||||
\begin{funcdesc}{getattr}{object, name}
|
||||
The arguments are an object and a string. The string must be the
|
||||
name of one of the object's attributes. The result is the value of
|
||||
that attribute. For example, \code{getattr(\var{x},
|
||||
|
@ -240,7 +240,7 @@ function or method, this is the module where it is defined, not the
|
|||
module from which it is called).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{hasattr}{object\, name}
|
||||
\begin{funcdesc}{hasattr}{object, name}
|
||||
The arguments are an object and a string. The result is 1 if the
|
||||
string is the name of one of the object's attributes, 0 if not.
|
||||
(This is implemented by calling \code{getattr(\var{object},
|
||||
|
@ -355,7 +355,7 @@ desired effect.
|
|||
see the description of \function{int()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{map}{function\, list\, ...}
|
||||
\begin{funcdesc}{map}{function, list, ...}
|
||||
Apply \var{function} to every item of \var{list} and return a list
|
||||
of the results. If additional \var{list} arguments are passed,
|
||||
\var{function} must take that many arguments and is applied to
|
||||
|
@ -388,7 +388,7 @@ any kind of sequence; the result is always a list.
|
|||
\exception{OverflowError} exception.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{open}{filename\optional{\, mode\optional{\, bufsize}}}
|
||||
\begin{funcdesc}{open}{filename\optional{, mode\optional{, bufsize}}}
|
||||
Return a new file object (described earlier under Built-in Types).
|
||||
The first two arguments are the same as for \code{stdio}'s
|
||||
\cfunction{fopen()}: \var{filename} is the file name to be opened,
|
||||
|
@ -423,7 +423,7 @@ there's no reliable way to determine whether this is the case.}
|
|||
\function{chr()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{pow}{x\, y\optional{\, z}}
|
||||
\begin{funcdesc}{pow}{x, y\optional{, z}}
|
||||
Return \var{x} to the power \var{y}; if \var{z} is present, return
|
||||
\var{x} to the power \var{y}, modulo \var{z} (computed more
|
||||
efficiently than \code{pow(\var{x}, \var{y}) \% \var{z}}).
|
||||
|
@ -435,7 +435,7 @@ there's no reliable way to determine whether this is the case.}
|
|||
35000)} is not allowed.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{range}{\optional{start\,} stop\optional{\, step}}
|
||||
\begin{funcdesc}{range}{\optional{start,} stop\optional{, step}}
|
||||
This is a versatile function to create lists containing arithmetic
|
||||
progressions. It is most often used in \keyword{for} loops. The
|
||||
arguments must be plain integers. If the \var{step} argument is
|
||||
|
@ -487,7 +487,7 @@ If the \module{readline} module was loaded, then
|
|||
line editing and history features.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{reduce}{function\, list\optional{\, initializer}}
|
||||
\begin{funcdesc}{reduce}{function, list\optional{, initializer}}
|
||||
Apply the binary \var{function} to the items of \var{list} so as to
|
||||
reduce the list to a single value. E.g.,
|
||||
\code{reduce(lambda x, y: x*y, \var{list}, 1)} returns the product of
|
||||
|
@ -551,7 +551,7 @@ to return a string that would yield an object with the same value
|
|||
when passed to \function{eval()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{round}{x\, n}
|
||||
\begin{funcdesc}{round}{x, n}
|
||||
Return the floating point value \var{x} rounded to \var{n} digits
|
||||
after the decimal point. If \var{n} is omitted, it defaults to zero.
|
||||
The result is a floating point number. Values are rounded to the
|
||||
|
@ -560,7 +560,7 @@ when passed to \function{eval()}.
|
|||
\code{round(0.5)} is \code{1.0} and \code{round(-0.5)} is \code{-1.0}).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setattr}{object\, name\, value}
|
||||
\begin{funcdesc}{setattr}{object, name, value}
|
||||
This is the counterpart of \function{getattr()}. The arguments are an
|
||||
object, a string and an arbitrary value. The string must be the name
|
||||
of one of the object's attributes. The function assigns the value to
|
||||
|
@ -569,7 +569,7 @@ when passed to \function{eval()}.
|
|||
\code{\var{x}.\var{foobar} = 123}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{slice}{\optional{start\,} stop\optional{\, step}}
|
||||
\begin{funcdesc}{slice}{\optional{start,} stop\optional{, step}}
|
||||
Return a slice object representing the set of indices specified by
|
||||
\code{range(\var{start}, \var{stop}, \var{step})}. The \var{start}
|
||||
and \var{step} arguments default to None. Slice objects have
|
||||
|
@ -623,7 +623,7 @@ cannot normally be affected this way, but variables retrieved from
|
|||
other scopes (e.g. modules) can be. This may change.}
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{xrange}{\optional{start\,} stop\optional{\, step}}
|
||||
\begin{funcdesc}{xrange}{\optional{start,} stop\optional{, step}}
|
||||
This function is very similar to \function{range()}, but returns an
|
||||
``xrange object'' instead of a list. This is an opaque sequence type
|
||||
which yields the same values as the corresponding list, without
|
||||
|
|
|
@ -35,7 +35,7 @@ Raised on \code{gdbm}-specific errors, such as I/O errors. \code{KeyError} is
|
|||
raised for general mapping errors like specifying an incorrect key.
|
||||
\end{excdesc}
|
||||
|
||||
\begin{funcdesc}{open}{filename\, \optional{flag\, \optional{mode}}}
|
||||
\begin{funcdesc}{open}{filename, \optional{flag, \optional{mode}}}
|
||||
Open a \code{gdbm} database and return a \code{gdbm} object. The
|
||||
\var{filename} argument is the name of the database file.
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ Similar to
|
|||
but the pairs have the point first and the normal second.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{nurbssurface}{s_k\, t_k\, ctl\, s_ord\, t_ord\, type}
|
||||
\begin{funcdesc}{nurbssurface}{s_k, t_k, ctl, s_ord, t_ord, type}
|
||||
% XXX s_k[], t_k[], ctl[][]
|
||||
Defines a nurbs surface.
|
||||
The dimensions of
|
||||
|
@ -129,13 +129,13 @@ are computed as follows:
|
|||
\code{[len(\var{t_k}) - \var{t_ord}]}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{nurbscurve}{knots\, ctlpoints\, order\, type}
|
||||
\begin{funcdesc}{nurbscurve}{knots, ctlpoints, order, type}
|
||||
Defines a nurbs curve.
|
||||
The length of ctlpoints is
|
||||
\code{len(\var{knots}) - \var{order}}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{pwlcurve}{points\, type}
|
||||
\begin{funcdesc}{pwlcurve}{points, type}
|
||||
Defines a piecewise-linear curve.
|
||||
\var{points}
|
||||
is a list of points.
|
||||
|
|
|
@ -86,7 +86,7 @@ affects the operation of \method{handle_data()} and \method{save_end()}.
|
|||
|
||||
\setindexsubitem{(HTMLParser method)}
|
||||
|
||||
\begin{funcdesc}{anchor_bgn}{href\, name\, type}
|
||||
\begin{funcdesc}{anchor_bgn}{href, name, type}
|
||||
This method is called at the start of an anchor region. The arguments
|
||||
correspond to the attributes of the \code{<A>} tag with the same
|
||||
names. The default implementation maintains a list of hyperlinks
|
||||
|
@ -100,7 +100,7 @@ implementation adds a textual footnote marker using an index into the
|
|||
list of hyperlinks created by \method{anchor_bgn()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{handle_image}{source\, alt\optional{\, ismap\optional{\, align\optional{\, width\optional{\, height}}}}}
|
||||
\begin{funcdesc}{handle_image}{source, alt\optional{, ismap\optional{, align\optional{, width\optional{, height}}}}}
|
||||
This method is called to handle images. The default implementation
|
||||
simply passes the \var{alt} value to the \method{handle_data()}
|
||||
method.
|
||||
|
|
|
@ -17,7 +17,7 @@ per pixel, etc.
|
|||
\end{excdesc}
|
||||
|
||||
|
||||
\begin{funcdesc}{crop}{image\, psize\, width\, height\, x0\, y0\, x1\, y1}
|
||||
\begin{funcdesc}{crop}{image, psize, width, height, x0, y0, x1, y1}
|
||||
Return the selected part of \var{image}, which should by
|
||||
\var{width} by \var{height} in size and consist of pixels of
|
||||
\var{psize} bytes. \var{x0}, \var{y0}, \var{x1} and \var{y1} are like
|
||||
|
@ -28,14 +28,14 @@ that fall outside the old image will have their value set to zero. If
|
|||
holds for the y coordinates.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{scale}{image\, psize\, width\, height\, newwidth\, newheight}
|
||||
\begin{funcdesc}{scale}{image, psize, width, height, newwidth, newheight}
|
||||
Return \var{image} scaled to size \var{newwidth} by \var{newheight}.
|
||||
No interpolation is done, scaling is done by simple-minded pixel
|
||||
duplication or removal. Therefore, computer-generated images or
|
||||
dithered images will not look nice after scaling.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{tovideo}{image\, psize\, width\, height}
|
||||
\begin{funcdesc}{tovideo}{image, psize, width, height}
|
||||
Run a vertical low-pass filter over an image. It does so by computing
|
||||
each destination pixel as the average of two vertically-aligned source
|
||||
pixels. The main use of this routine is to forestall excessive
|
||||
|
@ -43,18 +43,18 @@ flicker if the image is displayed on a video device that uses
|
|||
interlacing, hence the name.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{grey2mono}{image\, width\, height\, threshold}
|
||||
\begin{funcdesc}{grey2mono}{image, width, height, threshold}
|
||||
Convert a 8-bit deep greyscale image to a 1-bit deep image by
|
||||
tresholding all the pixels. The resulting image is tightly packed and
|
||||
is probably only useful as an argument to \code{mono2grey}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{dither2mono}{image\, width\, height}
|
||||
\begin{funcdesc}{dither2mono}{image, width, height}
|
||||
Convert an 8-bit greyscale image to a 1-bit monochrome image using a
|
||||
(simple-minded) dithering algorithm.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mono2grey}{image\, width\, height\, p0\, p1}
|
||||
\begin{funcdesc}{mono2grey}{image, width, height, p0, p1}
|
||||
Convert a 1-bit monochrome image to an 8 bit greyscale or color image.
|
||||
All pixels that are zero-valued on input get value \var{p0} on output
|
||||
and all one-value input pixels get value \var{p1} on output. To
|
||||
|
@ -62,26 +62,26 @@ convert a monochrome black-and-white image to greyscale pass the
|
|||
values \code{0} and \code{255} respectively.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{grey2grey4}{image\, width\, height}
|
||||
\begin{funcdesc}{grey2grey4}{image, width, height}
|
||||
Convert an 8-bit greyscale image to a 4-bit greyscale image without
|
||||
dithering.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{grey2grey2}{image\, width\, height}
|
||||
\begin{funcdesc}{grey2grey2}{image, width, height}
|
||||
Convert an 8-bit greyscale image to a 2-bit greyscale image without
|
||||
dithering.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{dither2grey2}{image\, width\, height}
|
||||
\begin{funcdesc}{dither2grey2}{image, width, height}
|
||||
Convert an 8-bit greyscale image to a 2-bit greyscale image with
|
||||
dithering. As for \code{dither2mono}, the dithering algorithm is
|
||||
currently very simple.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{grey42grey}{image\, width\, height}
|
||||
\begin{funcdesc}{grey42grey}{image, width, height}
|
||||
Convert a 4-bit greyscale image to an 8-bit greyscale image.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{grey22grey}{image\, width\, height}
|
||||
\begin{funcdesc}{grey22grey}{image, width, height}
|
||||
Convert a 2-bit greyscale image to an 8-bit greyscale image.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -30,7 +30,7 @@ the string. This format is suitable to pass to \code{gl.lrectwrite},
|
|||
for instance.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{readscaled}{file\, x\, y\, filter\optional{\, blur}}
|
||||
\begin{funcdesc}{readscaled}{file, x, y, filter\optional{, blur}}
|
||||
This function is identical to read but it returns an image that is
|
||||
scaled to the given \var{x} and \var{y} sizes. If the \var{filter} and
|
||||
\var{blur} parameters are omitted scaling is done by
|
||||
|
@ -55,7 +55,7 @@ compatible with SGI GL) or from top to bottom(flag is one,
|
|||
compatible with X). The default is zero.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{write}{file\, data\, x\, y\, z}
|
||||
\begin{funcdesc}{write}{file, data, x, y, z}
|
||||
This function writes the RGB or greyscale data in \var{data} to image
|
||||
file \var{file}. \var{x} and \var{y} give the size of the image,
|
||||
\var{z} is 1 for 1 byte greyscale images or 3 for RGB images (which are
|
||||
|
|
|
@ -188,7 +188,7 @@ shared libraries is highly system dependent, and not all systems
|
|||
support it.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{load_source}{name\, pathname\, file}
|
||||
\begin{funcdesc}{load_source}{name, pathname, file}
|
||||
Load and initialize a module implemented as a Python source file and
|
||||
return its module object. If the module was already initialized, it
|
||||
will be initialized \emph{again}. The \var{name} argument is used to
|
||||
|
|
|
@ -95,7 +95,7 @@ displayed in inverse video (this disables the upper half of a
|
|||
non-\ASCII{} character set).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{gotoxy}{x\, y}
|
||||
\begin{funcdesc}{gotoxy}{x, y}
|
||||
Set the cursor to position \code{(\var{x}, \var{y})}.
|
||||
\end{funcdesc}
|
||||
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
\label{module-macfs}
|
||||
\bimodindex{macfs}
|
||||
|
||||
\setindexsubitem{(in module macfs)}
|
||||
|
||||
This module provides access to macintosh FSSpec handling, the Alias
|
||||
This module provides access to Macintosh FSSpec handling, the Alias
|
||||
Manager, finder aliases and the Standard File package.
|
||||
|
||||
Whenever a function or method expects a \var{file} argument, this
|
||||
argument can be one of three things:\ (1) a full or partial Macintosh
|
||||
pathname, (2) an FSSpec object or (3) a 3-tuple \code{(wdRefNum,
|
||||
parID, name)} as described in Inside Mac VI\@. A description of aliases
|
||||
and the standard file package can also be found there.
|
||||
pathname, (2) an FSSpec object or (3) a 3-tuple \code{(\var{wdRefNum},
|
||||
\var{parID}, \var{name})} as described in \emph{Inside Macintosh
|
||||
VI}\@. A description of aliases and the standard file package can also
|
||||
be found there.
|
||||
|
||||
\begin{funcdesc}{FSSpec}{file}
|
||||
Create an FSSpec object for the specified file.
|
||||
|
@ -41,7 +41,7 @@ Resolve an alias file. Returns a 3-tuple \code{(\var{fsspec}, \var{isfolder},
|
|||
(otherwise the FSSpec object for the file itself is returned).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{StandardGetFile}{\optional{type\, ...}}
|
||||
\begin{funcdesc}{StandardGetFile}{\optional{type, ...}}
|
||||
Present the user with a standard ``open input file''
|
||||
dialog. Optionally, you can pass up to four 4-char file types to limit
|
||||
the files the user can choose from. The function returns an FSSpec
|
||||
|
@ -49,11 +49,11 @@ object and a flag indicating that the user completed the dialog
|
|||
without cancelling.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{PromptGetFile}{prompt\optional{\, type\, ...}}
|
||||
\begin{funcdesc}{PromptGetFile}{prompt\optional{, type, ...}}
|
||||
Similar to \var{StandardGetFile} but allows you to specify a prompt.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{StandardPutFile}{prompt\, \optional{default}}
|
||||
\begin{funcdesc}{StandardPutFile}{prompt, \optional{default}}
|
||||
Present the user with a standard ``open output file''
|
||||
dialog. \var{prompt} is the prompt string, and the optional
|
||||
\var{default} argument initializes the output file name. The function
|
||||
|
@ -79,7 +79,7 @@ behaviour with the ``general controls'' controlpanel, thereby making
|
|||
this call inoperative.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{FindFolder}{where\, which\, create}
|
||||
\begin{funcdesc}{FindFolder}{where, which, create}
|
||||
Locates one of the ``special'' folders that MacOS knows about, such as
|
||||
the trash or the Preferences folder. \var{Where} is the disk to
|
||||
search, \var{which} is the 4-char string specifying which folder to
|
||||
|
@ -133,7 +133,7 @@ Create a minimal alias pointing to this file.
|
|||
Return the 4-char creator and type of the file.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{SetCreatorType}{creator\, type}
|
||||
\begin{funcdesc}{SetCreatorType}{creator, type}
|
||||
Set the 4-char creator and type of the file.
|
||||
\end{funcdesc}
|
||||
|
||||
|
@ -151,7 +151,7 @@ Return a tuple with three floating point values representing the
|
|||
creation date, modification date and backup date of the file.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{SetDates}{crdate\, moddate\, backupdate}
|
||||
\begin{funcdesc}{SetDates}{crdate, moddate, backupdate}
|
||||
Set the creation, modification and backup date of the file. The values
|
||||
are in the standard floating point format used for times throughout
|
||||
Python.
|
||||
|
@ -179,7 +179,7 @@ is returned.
|
|||
An interface to the C routine \code{GetAliasInfo()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{Update}{file\, \optional{file2}}
|
||||
\begin{funcdesc}{Update}{file, \optional{file2}}
|
||||
Update the alias to point to the \var{file} given. If \var{file2} is
|
||||
present a relative alias will be created.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -9,7 +9,7 @@ The \code{macostools} module defines the following functions:
|
|||
|
||||
\setindexsubitem{(in module macostools)}
|
||||
|
||||
\begin{funcdesc}{copy}{src\, dst\optional{\, createpath, copytimes}}
|
||||
\begin{funcdesc}{copy}{src, dst\optional{, createpath, copytimes}}
|
||||
Copy file \var{src} to \var{dst}. The files can be specified as
|
||||
pathnames or \code{FSSpec} objects. If \var{createpath} is non-zero
|
||||
\var{dst} must be a pathname and the folders leading to the
|
||||
|
@ -22,13 +22,13 @@ If the source is an alias the original to which the alias points is
|
|||
copied, not the aliasfile.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{copytree}{src\, dst}
|
||||
\begin{funcdesc}{copytree}{src, dst}
|
||||
Recursively copy a file tree from \var{src} to \var{dst}, creating
|
||||
folders as needed. \var{Src} and \var{dst} should be specified as
|
||||
pathnames.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mkalias}{src\, dst}
|
||||
\begin{funcdesc}{mkalias}{src, dst}
|
||||
Create a finder alias \var{dst} pointing to \var{src}. Both may be
|
||||
specified as pathnames or \var{FSSpec} objects.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -78,13 +78,13 @@ Return the TCP address of this side of a connection as a 2-tuple
|
|||
\code{(host, port)}, both integers.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ActiveOpen}{lport\, host\, rport}
|
||||
\begin{funcdesc}{ActiveOpen}{lport, host, rport}
|
||||
Open an outgoing connection to TCP address \code{(\var{host}, \var{rport})}. Use
|
||||
local port \var{lport} (zero makes the system pick a free port). This
|
||||
call blocks until the connection has been established.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{Send}{buf\, push\, urgent}
|
||||
\begin{funcdesc}{Send}{buf, push, urgent}
|
||||
Send data \var{buf} over the connection. \var{Push} and \var{urgent}
|
||||
are flags as specified by the TCP standard.
|
||||
\end{funcdesc}
|
||||
|
@ -168,7 +168,7 @@ Read a datagram, waiting at most \var{timeout} seconds (-1 is
|
|||
infinite). Return the data.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{Write}{host\, port\, buf}
|
||||
\begin{funcdesc}{Write}{host, port, buf}
|
||||
Send \var{buf} as a datagram to IP-address \var{host}, port
|
||||
\var{port}.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -18,7 +18,7 @@ most 255 characters long, is displayed. Control is returned when the
|
|||
user clicks ``OK''.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{AskString}{prompt\optional{\, default}}
|
||||
\begin{funcdesc}{AskString}{prompt\optional{, default}}
|
||||
Ask the user to input a string value, in a modal dialog. \var{Prompt}
|
||||
is the promt message, the optional \var{default} arg is the initial
|
||||
value for the string. All strings can be at most 255 bytes
|
||||
|
@ -26,7 +26,7 @@ long. \var{AskString} returns the string entered or \code{None} in
|
|||
case the user cancelled.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{AskYesNoCancel}{question\optional{\, default}}
|
||||
\begin{funcdesc}{AskYesNoCancel}{question\optional{, default}}
|
||||
Present a dialog with text \var{question} and three buttons labelled
|
||||
``yes'', ``no'' and ``cancel''. Return \code{1} for yes, \code{0} for
|
||||
no and \code{-1} for cancel. The default return value chosen by
|
||||
|
@ -34,7 +34,7 @@ hitting return is \code{0}. This can be changed with the optional
|
|||
\var{default} argument.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ProgressBar}{\optional{label\, maxval}}
|
||||
\begin{funcdesc}{ProgressBar}{\optional{label, maxval}}
|
||||
Display a modeless progress dialog with a thermometer bar. \var{Label}
|
||||
is the textstring displayed (default ``Working...''), \var{maxval} is
|
||||
the value at which progress is complete (default 100). The returned
|
||||
|
|
|
@ -17,7 +17,7 @@ Configuration Mechanism For Multimedia Mail Format Information,'' but
|
|||
is not an Internet standard. However, mailcap files are supported on
|
||||
most \UNIX{} systems.
|
||||
|
||||
\begin{funcdesc}{findmatch}{caps\, MIMEtype\, key\, filename\, plist}
|
||||
\begin{funcdesc}{findmatch}{caps, MIMEtype, key, filename, plist}
|
||||
Return a 2-tuple; the first element is a string containing the command
|
||||
line to be executed
|
||||
(which can be passed to \code{os.system()}), and the second element is
|
||||
|
|
|
@ -30,18 +30,18 @@ object \var{input} and write the decoded data to open file object
|
|||
\code{'base64'}, \code{'quoted-printable'} and \code{'uuencode'}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{encode}{input\, output\, encoding}
|
||||
\begin{funcdesc}{encode}{input, output, encoding}
|
||||
Read data from open file object \var{input} and write it encoded using
|
||||
the allowed MIME \var{encoding} to open file object \var{output}.
|
||||
Valid values for \var{encoding} are the same as for \method{decode()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{copyliteral}{input\, output}
|
||||
\begin{funcdesc}{copyliteral}{input, output}
|
||||
Read lines until \EOF{} from open file \var{input} and write them to
|
||||
open file \var{output}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{copybinary}{input\, output}
|
||||
\begin{funcdesc}{copybinary}{input, output}
|
||||
Read blocks until \EOF{} from open file \var{input} and write them to
|
||||
open file \var{output}. The block size is currently fixed at 8192.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -36,14 +36,14 @@ provide its own windows, etc.
|
|||
|
||||
\setindexsubitem{(AEServer method)}
|
||||
|
||||
\begin{funcdesc}{installaehandler}{classe\, type\, callback}
|
||||
\begin{funcdesc}{installaehandler}{classe, type, callback}
|
||||
Installs an AppleEvent handler. \code{Classe} and \code{type} are the
|
||||
four-char OSA Class and Type designators, \code{'****'} wildcards are
|
||||
allowed. When a matching AppleEvent is received the parameters are
|
||||
decoded and your callback is invoked.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{callback}{_object\, **kwargs}
|
||||
\begin{funcdesc}{callback}{_object, **kwargs}
|
||||
Your callback is called with the OSA Direct Object as first positional
|
||||
parameter. The other parameters are passed as keyword arguments, with
|
||||
the 4-char designator as name. Three extra keyword parameters are
|
||||
|
|
|
@ -37,17 +37,17 @@ A number of \emph{extra} functions are defined in this module. Non
|
|||
mpz-arguments are converted to mpz-values first, and the functions
|
||||
return mpz-numbers.
|
||||
|
||||
\begin{funcdesc}{powm}{base\, exponent\, modulus}
|
||||
\begin{funcdesc}{powm}{base, exponent, modulus}
|
||||
Return \code{pow(\var{base}, \var{exponent}) \%{} \var{modulus}}. If
|
||||
\code{\var{exponent} == 0}, return \code{mpz(1)}. In contrast to the
|
||||
\C-library function, this version can handle negative exponents.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{gcd}{op1\, op2}
|
||||
\begin{funcdesc}{gcd}{op1, op2}
|
||||
Return the greatest common divisor of \var{op1} and \var{op2}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{gcdext}{a\, b}
|
||||
\begin{funcdesc}{gcdext}{a, b}
|
||||
Return a tuple \code{(\var{g}, \var{s}, \var{t})}, such that
|
||||
\code{\var{a}*\var{s} + \var{b}*\var{t} == \var{g} == gcd(\var{a}, \var{b})}.
|
||||
\end{funcdesc}
|
||||
|
@ -61,7 +61,7 @@ return mpz-numbers.
|
|||
\code{\var{root}*\var{root} + \var{remainder} == \var{op}}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{divm}{numerator\, denominator\, modulus}
|
||||
\begin{funcdesc}{divm}{numerator, denominator, modulus}
|
||||
Returns a number \var{q}. such that
|
||||
\code{\var{q} * \var{denominator} \%{} \var{modulus} == \var{numerator}}.
|
||||
One could also implement this function in Python, using \code{gcdext}.
|
||||
|
|
|
@ -153,7 +153,7 @@ converted to parse trees represented as list- or tuple- trees, or may
|
|||
be compiled into executable code objects. Parse trees may be
|
||||
extracted with or without line numbering information.
|
||||
|
||||
\begin{funcdesc}{ast2list}{ast\optional{\, line_info\code{ = 0}}}
|
||||
\begin{funcdesc}{ast2list}{ast\optional{, line_info\code{ = 0}}}
|
||||
This function accepts an AST object from the caller in
|
||||
\code{\var{ast}} and returns a Python list representing the
|
||||
equivelent parse tree. The resulting list representation can be used
|
||||
|
@ -172,7 +172,7 @@ the line on which the token \emph{ends}. This information is
|
|||
omitted if the flag is false or omitted.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ast2tuple}{ast\optional{\, line_info\code{ = 0}}}
|
||||
\begin{funcdesc}{ast2tuple}{ast\optional{, line_info\code{ = 0}}}
|
||||
This function accepts an AST object from the caller in
|
||||
\code{\var{ast}} and returns a Python tuple representing the
|
||||
equivelent parse tree. Other than returning a tuple instead of a
|
||||
|
@ -184,7 +184,7 @@ representing the token. This information is omitted if the flag is
|
|||
false or omitted.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{compileast}{ast\optional{\, filename\code{ = '<ast>'}}}
|
||||
\begin{funcdesc}{compileast}{ast\optional{, filename\code{ = '<ast>'}}}
|
||||
The Python byte compiler can be invoked on an AST object to produce
|
||||
code objects which can be used as part of an \code{exec} statement or
|
||||
a call to the built-in \function{eval()}\bifuncindex{eval} function.
|
||||
|
|
|
@ -69,7 +69,7 @@ NameError: spam
|
|||
The module defines the following functions; each enters the debugger
|
||||
in a slightly different way:
|
||||
|
||||
\begin{funcdesc}{run}{statement\optional{\, globals\optional{\, locals}}}
|
||||
\begin{funcdesc}{run}{statement\optional{, globals\optional{, locals}}}
|
||||
Execute the \var{statement} (given as a string) under debugger
|
||||
control. The debugger prompt appears before any code is executed; you
|
||||
can set breakpoints and type \code{continue}, or you can step through
|
||||
|
@ -81,14 +81,14 @@ the explanation of the \code{exec} statement or the \code{eval()}
|
|||
built-in function.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{runeval}{expression\optional{\, globals\optional{\, locals}}}
|
||||
\begin{funcdesc}{runeval}{expression\optional{, globals\optional{, locals}}}
|
||||
Evaluate the \var{expression} (given as a a string) under debugger
|
||||
control. When \code{runeval()} returns, it returns the value of the
|
||||
expression. Otherwise this function is similar to
|
||||
\code{run()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{runcall}{function\optional{\, argument\, ...}}
|
||||
\begin{funcdesc}{runcall}{function\optional{, argument, ...}}
|
||||
Call the \var{function} (a function or method object, not a string)
|
||||
with the given arguments. When \code{runcall()} returns, it returns
|
||||
whatever the function call returned. The debugger prompt appears as
|
||||
|
|
|
@ -229,7 +229,7 @@ Collection may also become a problem here.)
|
|||
Apart from the \code{Pickler} and \code{Unpickler} classes, the
|
||||
module defines the following functions, and an exception:
|
||||
|
||||
\begin{funcdesc}{dump}{object\, file\optional{, bin}}
|
||||
\begin{funcdesc}{dump}{object, file\optional{, bin}}
|
||||
Write a pickled representation of \var{obect} to the open file object
|
||||
\var{file}. This is equivalent to
|
||||
\code{Pickler(\var{file}, \var{bin}).dump(\var{object})}.
|
||||
|
|
|
@ -79,11 +79,11 @@ It defines the following functions and constants:
|
|||
Change the current working directory to \var{path}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{chmod}{path\, mode}
|
||||
\begin{funcdesc}{chmod}{path, mode}
|
||||
Change the mode of \var{path} to the numeric \var{mode}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{chown}{path\, uid, gid}
|
||||
\begin{funcdesc}{chown}{path, uid, gid}
|
||||
Change the owner and group id of \var{path} to the numeric \var{uid}
|
||||
and \var{gid}.
|
||||
(Not on MS-DOS.)
|
||||
|
@ -103,19 +103,19 @@ built-in function \function{open()} or by \function{popen()} or
|
|||
Return a duplicate of file descriptor \var{fd}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{dup2}{fd\, fd2}
|
||||
\begin{funcdesc}{dup2}{fd, fd2}
|
||||
Duplicate file descriptor \var{fd} to \var{fd2}, closing the latter
|
||||
first if necessary.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{execv}{path\, args}
|
||||
\begin{funcdesc}{execv}{path, args}
|
||||
Execute the executable \var{path} with argument list \var{args},
|
||||
replacing the current process (i.e., the Python interpreter).
|
||||
The argument list may be a tuple or list of strings.
|
||||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{execve}{path\, args\, env}
|
||||
\begin{funcdesc}{execve}{path, args, env}
|
||||
Execute the executable \var{path} with argument list \var{args},
|
||||
and environment \var{env},
|
||||
replacing the current process (i.e., the Python interpreter).
|
||||
|
@ -134,7 +134,7 @@ Note: the standard way to exit is \code{sys.exit(\var{n})}.
|
|||
after a \function{fork()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{fdopen}{fd\optional{\, mode\optional{\, bufsize}}}
|
||||
\begin{funcdesc}{fdopen}{fd\optional{, mode\optional{, bufsize}}}
|
||||
Return an open file object connected to the file descriptor \var{fd}.
|
||||
The \var{mode} and \var{bufsize} arguments have the same meaning as
|
||||
the corresponding arguments to the built-in \function{open()} function.
|
||||
|
@ -150,7 +150,7 @@ process id in the parent.
|
|||
Return status for file descriptor \var{fd}, like \function{stat()}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{ftruncate}{fd\, length}
|
||||
\begin{funcdesc}{ftruncate}{fd, length}
|
||||
Truncate the file corresponding to file descriptor \var{fd},
|
||||
so that it is at most \var{length} bytes in size.
|
||||
\end{funcdesc}
|
||||
|
@ -194,12 +194,12 @@ Return the current process' user id.
|
|||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{kill}{pid\, sig}
|
||||
\begin{funcdesc}{kill}{pid, sig}
|
||||
Kill the process \var{pid} with signal \var{sig}.
|
||||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{link}{src\, dst}
|
||||
\begin{funcdesc}{link}{src, dst}
|
||||
Create a hard link pointing to \var{src} named \var{dst}.
|
||||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
@ -211,7 +211,7 @@ entries \code{'.'} and \code{'..'} even if they are present in the
|
|||
directory.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{lseek}{fd\, pos\, how}
|
||||
\begin{funcdesc}{lseek}{fd, pos, how}
|
||||
Set the current position of file descriptor \var{fd} to position
|
||||
\var{pos}, modified by \var{how}: \code{0} to set the position
|
||||
relative to the beginning of the file; \code{1} to set it relative to
|
||||
|
@ -224,7 +224,7 @@ Like \function{stat()}, but do not follow symbolic links. (On systems
|
|||
without symbolic links, this is identical to \function{stat()}.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mkfifo}{path\optional{\, mode}}
|
||||
\begin{funcdesc}{mkfifo}{path\optional{, mode}}
|
||||
Create a FIFO (a \POSIX{} named pipe) named \var{path} with numeric mode
|
||||
\var{mode}. The default \var{mode} is \code{0666} (octal). The current
|
||||
umask value is first masked out from the mode.
|
||||
|
@ -238,7 +238,7 @@ the client opens it for writing. Note that \function{mkfifo()}
|
|||
doesn't open the FIFO --- it just creates the rendezvous point.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{mkdir}{path\optional{\, mode}}
|
||||
\begin{funcdesc}{mkdir}{path\optional{, mode}}
|
||||
Create a directory named \var{path} with numeric mode \var{mode}.
|
||||
The default \var{mode} is \code{0777} (octal). On some systems,
|
||||
\var{mode} is ignored. Where it is used, the current umask value is
|
||||
|
@ -250,7 +250,7 @@ Add \var{increment} to the process' ``niceness''. Return the new
|
|||
niceness. (Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{open}{file\, flags\optional{\, mode}}
|
||||
\begin{funcdesc}{open}{file, flags\optional{, mode}}
|
||||
Open the file \var{file} and set various flags according to
|
||||
\var{flags} and possibly its mode according to \var{mode}.
|
||||
The default \var{mode} is \code{0777} (octal), and the current umask
|
||||
|
@ -279,7 +279,7 @@ Lock program segments into memory. The value of \var{op}
|
|||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{popen}{command\optional{\, mode\optional{\, bufsize}}}
|
||||
\begin{funcdesc}{popen}{command\optional{, mode\optional{, bufsize}}}
|
||||
Open a pipe to or from \var{command}. The return value is an open
|
||||
file object connected to the pipe, which can be read or written
|
||||
depending on whether \var{mode} is \code{'r'} (default) or \code{'w'}.
|
||||
|
@ -291,7 +291,7 @@ object.
|
|||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{putenv}{varname\, value}
|
||||
\begin{funcdesc}{putenv}{varname, value}
|
||||
\index{environment variables!setting}
|
||||
Set the environment variable named \var{varname} to the string
|
||||
\var{value}. Such changes to the environment affect subprocesses
|
||||
|
@ -309,7 +309,7 @@ actually preferable to assign to items of \code{os.environ}.
|
|||
Return the error message corresponding to the error code in \var{code}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{read}{fd\, n}
|
||||
\begin{funcdesc}{read}{fd, n}
|
||||
Read at most \var{n} bytes from file descriptor \var{fd}.
|
||||
Return a string containing the bytes read.
|
||||
|
||||
|
@ -333,7 +333,7 @@ directory. This is identical to the \function{unlink()} function
|
|||
documented below.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{rename}{src\, dst}
|
||||
\begin{funcdesc}{rename}{src, dst}
|
||||
Rename the file or directory \var{src} to \var{dst}.
|
||||
\end{funcdesc}
|
||||
|
||||
|
@ -353,7 +353,7 @@ Calls the system call \cfunction{setpgrp()} or \cfunction{setpgrp(0,
|
|||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{setpgid}{pid\, pgrp}
|
||||
\begin{funcdesc}{setpgid}{pid, pgrp}
|
||||
Calls the system call \cfunction{setpgid()}. See the \UNIX{} manual
|
||||
for the semantics.
|
||||
(Not on MS-DOS.)
|
||||
|
@ -393,7 +393,7 @@ functions and constants that are useful for extracting information
|
|||
from a stat structure.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{symlink}{src\, dst}
|
||||
\begin{funcdesc}{symlink}{src, dst}
|
||||
Create a symbolic link pointing to \var{src} named \var{dst}. (On
|
||||
systems without symbolic links, this always raises \exception{error}.)
|
||||
\end{funcdesc}
|
||||
|
@ -413,7 +413,7 @@ Return the process group associated with the terminal given by
|
|||
(Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{tcsetpgrp}{fd\, pg}
|
||||
\begin{funcdesc}{tcsetpgrp}{fd, pg}
|
||||
Set the process group associated with the terminal given by
|
||||
\var{fd} (an open file descriptor as returned by \function{open()})
|
||||
to \var{pg}.
|
||||
|
@ -453,7 +453,7 @@ Remove the file \var{path}. This is the same function as \code{remove};
|
|||
the \code{unlink} name is its traditional \UNIX{} name.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{utime}{path\, {\rm (}atime, mtime{\rm )}}
|
||||
\begin{funcdesc}{utime}{path, {\rm (}atime, mtime{\rm )}}
|
||||
Set the access and modified time of the file to the given values.
|
||||
(The second argument is a tuple of two items.)
|
||||
\end{funcdesc}
|
||||
|
@ -466,7 +466,7 @@ exit status (if the signal number is zero); the high bit of the low
|
|||
byte is set if a core file was produced. (Not on MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{waitpid}{pid\, options}
|
||||
\begin{funcdesc}{waitpid}{pid, options}
|
||||
Wait for completion of a child process given by proces id, and return
|
||||
a tuple containing its pid and exit status indication (encoded as for
|
||||
\function{wait()}). The semantics of the call are affected by the
|
||||
|
@ -476,7 +476,7 @@ normal operation. (If the system does not support
|
|||
MS-DOS.)
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{write}{fd\, str}
|
||||
\begin{funcdesc}{write}{fd, str}
|
||||
Write the string \var{str} to file descriptor \var{fd}.
|
||||
Return the number of bytes actually written.
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ different device than \var{p}, or whether \file{\var{p}/..} and
|
|||
detect mount points for all \UNIX{} and \POSIX{} variants.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{join}{p\optional{\, q\optional{\, ...}}}
|
||||
\begin{funcdesc}{join}{p\optional{, q\optional{, ...}}}
|
||||
Joins one or more path components intelligently. If any component is
|
||||
an absolute path, all previous components are thrown away, and joining
|
||||
continues. The return value is the concatenation of \var{p}, and
|
||||
|
@ -103,7 +103,7 @@ case (use \function{normcase()} for that). On Windows, it does
|
|||
converts forward slashes to backward slashes.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{samefile}{p\, q}
|
||||
\begin{funcdesc}{samefile}{p, q}
|
||||
Return true if both pathname arguments refer to the same file or
|
||||
directory (as indicated by device number and i-node number).
|
||||
Raise an exception if a \function{os.stat()} call on either pathname
|
||||
|
@ -130,7 +130,7 @@ and \var{ext} is empty or begins with a period and contains
|
|||
at most one period.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{walk}{p\, visit\, arg}
|
||||
\begin{funcdesc}{walk}{p, visit, arg}
|
||||
Calls the function \var{visit} with arguments
|
||||
\code{(\var{arg}, \var{dirname}, \var{names})} for each directory in the
|
||||
directory tree rooted at \var{p} (including \var{p} itself, if it is a
|
||||
|
|
|
@ -269,7 +269,7 @@ Profiler Extensions, which includes discussion of how to derive
|
|||
``better'' profilers from the classes presented, or reading the source
|
||||
code for these modules.
|
||||
|
||||
\begin{funcdesc}{profile.run}{string\optional{\, filename\optional{\, ...}}}
|
||||
\begin{funcdesc}{profile.run}{string\optional{, filename\optional{, ...}}}
|
||||
|
||||
This function takes a single argument that has can be passed to the
|
||||
\keyword{exec} statement, and an optional file name. In all cases this
|
||||
|
@ -338,7 +338,7 @@ Analysis of the profiler data is done using this class from the
|
|||
|
||||
\setindexsubitem{(in module pstats)}
|
||||
|
||||
\begin{classdesc}{Stats}{filename\optional{\, ...}}
|
||||
\begin{classdesc}{Stats}{filename\optional{, ...}}
|
||||
This class constructor creates an instance of a ``statistics object''
|
||||
from a \var{filename} (or set of filenames). \class{Stats} objects are
|
||||
manipulated by methods, in order to print useful reports.
|
||||
|
@ -375,7 +375,7 @@ statistics for these two entries are accumulated into a single entry.
|
|||
\end{funcdesc}
|
||||
|
||||
|
||||
\begin{funcdesc}{add}{filename\optional{\, ...}}
|
||||
\begin{funcdesc}{add}{filename\optional{, ...}}
|
||||
This method of the \class{Stats} class accumulates additional
|
||||
profiling information into the current profiling object. Its
|
||||
arguments should refer to filenames created by the corresponding
|
||||
|
@ -384,7 +384,7 @@ version of \function{profile.run()}. Statistics for identically named
|
|||
single function statistics.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{sort_stats}{key\optional{\, ...}}
|
||||
\begin{funcdesc}{sort_stats}{key\optional{, ...}}
|
||||
This method modifies the \class{Stats} object by sorting it according
|
||||
to the supplied criteria. The argument is typically a string
|
||||
identifying the basis of a sort (example: \code{"time"} or
|
||||
|
@ -441,7 +441,7 @@ now that ascending vs descending order is properly selected based on
|
|||
the sort key of choice.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{print_stats}{restriction\optional{\, ...}}
|
||||
\begin{funcdesc}{print_stats}{restriction\optional{, ...}}
|
||||
This method for the \class{Stats} class prints out a report as described
|
||||
in the \function{profile.run()} definition.
|
||||
|
||||
|
@ -476,7 +476,7 @@ and then proceed to only print the first 10\% of them.
|
|||
\end{funcdesc}
|
||||
|
||||
|
||||
\begin{funcdesc}{print_callers}{restrictions\optional{\, ...}}
|
||||
\begin{funcdesc}{print_callers}{restrictions\optional{, ...}}
|
||||
This method for the \class{Stats} class prints a list of all functions
|
||||
that called each function in the profiled database. The ordering is
|
||||
identical to that provided by \method{print_stats()}, and the definition
|
||||
|
@ -486,7 +486,7 @@ times this specific call was made. A second non-parenthesized number
|
|||
is the cumulative time spent in the function at the right.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{print_callees}{restrictions\optional{\, ...}}
|
||||
\begin{funcdesc}{print_callees}{restrictions\optional{, ...}}
|
||||
This method for the \class{Stats} class prints a list of all function
|
||||
that were called by the indicated function. Aside from this reversal
|
||||
of direction of calls (re: called vs was called by), the arguments and
|
||||
|
|
|
@ -13,7 +13,7 @@ are many such characters, as when sending a graphics file.
|
|||
|
||||
\setindexsubitem{(in module quopri)}
|
||||
|
||||
\begin{funcdesc}{decode}{input\, output}
|
||||
\begin{funcdesc}{decode}{input, output}
|
||||
Decode the contents of the \var{input} file and write the resulting
|
||||
decoded binary data to the \var{output} file.
|
||||
\var{input} and \var{output} must either be file objects or objects that
|
||||
|
@ -21,7 +21,7 @@ mimic the file object interface. \var{input} will be read until
|
|||
\code{\var{input}.read()} returns an empty string.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{encode}{input\, output\, quotetabs}
|
||||
\begin{funcdesc}{encode}{input, output, quotetabs}
|
||||
Encode the contents of the \var{input} file and write the resulting
|
||||
quoted-printable data to the \var{output} file.
|
||||
\var{input} and \var{output} must either be file objects or objects that
|
||||
|
|
|
@ -192,21 +192,21 @@ The module defines these functions, and an exception:
|
|||
|
||||
\setindexsubitem{(in module regex)}
|
||||
|
||||
\begin{funcdesc}{match}{pattern\, string}
|
||||
\begin{funcdesc}{match}{pattern, string}
|
||||
Return how many characters at the beginning of \var{string} match
|
||||
the regular expression \var{pattern}. Return \code{-1} if the
|
||||
string does not match the pattern (this is different from a
|
||||
zero-length match!).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{search}{pattern\, string}
|
||||
\begin{funcdesc}{search}{pattern, string}
|
||||
Return the first position in \var{string} that matches the regular
|
||||
expression \var{pattern}. Return \code{-1} if no position in the string
|
||||
matches the pattern (this is different from a zero-length match
|
||||
anywhere!).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{compile}{pattern\optional{\, translate}}
|
||||
\begin{funcdesc}{compile}{pattern\optional{, translate}}
|
||||
Compile a regular expression pattern into a regular expression
|
||||
object, which can be used for matching using its \code{match()} and
|
||||
\code{search()} methods, described below. The optional argument
|
||||
|
@ -252,7 +252,7 @@ expressions.)
|
|||
Returns the current value of the syntax flags as an integer.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{symcomp}{pattern\optional{\, translate}}
|
||||
\begin{funcdesc}{symcomp}{pattern\optional{, translate}}
|
||||
This is like \code{compile()}, but supports symbolic group names: if a
|
||||
parenthesis-enclosed group begins with a group name in angular
|
||||
brackets, e.g. \code{'\e(<id>[a-z][a-z0-9]*\e)'}, the group can
|
||||
|
@ -279,7 +279,7 @@ equivalents.
|
|||
Compiled regular expression objects support these methods:
|
||||
|
||||
\setindexsubitem{(regex method)}
|
||||
\begin{funcdesc}{match}{string\optional{\, pos}}
|
||||
\begin{funcdesc}{match}{string\optional{, pos}}
|
||||
Return how many characters at the beginning of \var{string} match
|
||||
the compiled regular expression. Return \code{-1} if the string
|
||||
does not match the pattern (this is different from a zero-length
|
||||
|
@ -293,7 +293,7 @@ Compiled regular expression objects support these methods:
|
|||
is to start.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{search}{string\optional{\, pos}}
|
||||
\begin{funcdesc}{search}{string\optional{, pos}}
|
||||
Return the first position in \var{string} that matches the regular
|
||||
expression \code{pattern}. Return \code{-1} if no position in the
|
||||
string matches the pattern (this is different from a zero-length
|
||||
|
@ -303,7 +303,7 @@ Compiled regular expression objects support these methods:
|
|||
\code{match()} method.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{group}{index\, index\, ...}
|
||||
\begin{funcdesc}{group}{index, index, ...}
|
||||
This method is only valid when the last call to the \code{match()}
|
||||
or \code{search()} method found a match. It returns one or more
|
||||
groups of the match. If there is a single \var{index} argument,
|
||||
|
|
|
@ -20,7 +20,7 @@ conversion help, see the URL
|
|||
|
||||
\setindexsubitem{(in module regsub)}
|
||||
|
||||
\begin{funcdesc}{sub}{pat\, repl\, str}
|
||||
\begin{funcdesc}{sub}{pat, repl, str}
|
||||
Replace the first occurrence of pattern \var{pat} in string
|
||||
\var{str} by replacement \var{repl}. If the pattern isn't found,
|
||||
the string is returned unchanged. The pattern may be a string or an
|
||||
|
@ -28,7 +28,7 @@ already compiled pattern. The replacement may contain references
|
|||
\samp{\e \var{digit}} to subpatterns and escaped backslashes.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{gsub}{pat\, repl\, str}
|
||||
\begin{funcdesc}{gsub}{pat, repl, str}
|
||||
Replace all (non-overlapping) occurrences of pattern \var{pat} in
|
||||
string \var{str} by replacement \var{repl}. The same rules as for
|
||||
\code{sub()} apply. Empty matches for the pattern are replaced only
|
||||
|
@ -36,7 +36,7 @@ when not adjacent to a previous match, so e.g.
|
|||
\code{gsub('', '-', 'abc')} returns \code{'-a-b-c-'}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{split}{str\, pat\optional{\, maxsplit}}
|
||||
\begin{funcdesc}{split}{str, pat\optional{, maxsplit}}
|
||||
Split the string \var{str} in fields separated by delimiters matching
|
||||
the pattern \var{pat}, and return a list containing the fields. Only
|
||||
non-empty matches for the pattern are considered, so e.g.
|
||||
|
@ -47,7 +47,7 @@ occur, and the remainder of the string is returned as the final
|
|||
element of the list.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{splitx}{str\, pat\optional{\, maxsplit}}
|
||||
\begin{funcdesc}{splitx}{str, pat\optional{, maxsplit}}
|
||||
Split the string \var{str} in fields separated by delimiters matching
|
||||
the pattern \var{pat}, and return a list containing the fields as well
|
||||
as the separators. For example, \code{splitx('a:::b', ':*')} returns
|
||||
|
@ -55,7 +55,7 @@ as the separators. For example, \code{splitx('a:::b', ':*')} returns
|
|||
as \code{split}.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{capwords}{s\optional{\, pat}}
|
||||
\begin{funcdesc}{capwords}{s\optional{, pat}}
|
||||
Capitalize words separated by optional pattern \var{pat}. The default
|
||||
pattern uses any characters except letters, digits and underscores as
|
||||
word delimiters. Capitalization is done by changing the first
|
||||
|
|
|
@ -151,7 +151,7 @@ Import the module \var{modulename}, raising an \exception{ImportError}
|
|||
exception if the module is considered unsafe.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{r_open}{filename\optional{\, mode\optional{\, bufsize}}}
|
||||
\begin{funcdesc}{r_open}{filename\optional{, mode\optional{, bufsize}}}
|
||||
Method called when \function{open()} is called in the restricted
|
||||
environment. The arguments are identical to those of \function{open()},
|
||||
and a file object (or a class instance compatible with file objects)
|
||||
|
@ -172,7 +172,7 @@ restricted environment's \code{sys.modules} dictionary).
|
|||
|
||||
And their equivalents with access to restricted standard I/O streams:
|
||||
|
||||
\begin{funcdesc}{s_import}{modulename\optional{\, globals, locals, fromlist}}
|
||||
\begin{funcdesc}{s_import}{modulename\optional{, globals, locals, fromlist}}
|
||||
Import the module \var{modulename}, raising an \exception{ImportError}
|
||||
exception if the module is considered unsafe.
|
||||
\end{funcdesc}
|
||||
|
|
|
@ -29,7 +29,7 @@ the string. This format is suitable to pass to \code{gl.lrectwrite},
|
|||
for instance.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{longstoimage}{data\, x\, y\, z\, file}
|
||||
\begin{funcdesc}{longstoimage}{data, x, y, z, file}
|
||||
This function writes the RGBA data in \var{data} to image
|
||||
file \var{file}. \var{x} and \var{y} give the size of the image.
|
||||
\var{z} is 1 if the saved image should be 1 byte greyscale, 3 if the
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue