annotate Doc/lib/libbase64.tex @ 21467:4e35fa5d5708 legacy-trunk

Add documentation for the help() built-in; contributed by Ka-Ping Yee. This is part of SF patch #494622.
author Fred Drake <fdrake@acm.org>
date Tue, 18 Dec 2001 16:31:08 +0000
parents bc02c3b09626
children be54ba4b2c44
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8918
acfffe14628e New section header style.
Fred Drake <fdrake@acm.org>
parents: 8716
diff changeset
1 \section{\module{base64} ---
10255
0614e7f16741 More reasonable section titles.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
2 Encode and decode MIME base64 data}
0614e7f16741 More reasonable section titles.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
3
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 8416
diff changeset
4 \declaremodule{standard}{base64}
10255
0614e7f16741 More reasonable section titles.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
5 \modulesynopsis{Encode and decode files using the MIME base64 data.}
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 8416
diff changeset
6
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 8416
diff changeset
7
7788
b1c091501411 Be more specific about where in RFC 1421 to look, since it's not at all
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
8 \indexii{base64}{encoding}
b1c091501411 Be more specific about where in RFC 1421 to look, since it's not at all
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
9 \index{MIME!base64 encoding}
5344
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
10
8416
9ea50031149c Minor grammatical correction: "This module perform ..." --> "This module
Fred Drake <fdrake@acm.org>
parents: 7873
diff changeset
11 This module performs base64 encoding and decoding of arbitrary binary
18574
346dcafc878b Minor changes to match the style guide.
Fred Drake <fdrake@acm.org>
parents: 17448
diff changeset
12 strings into text strings that can be safely sent by email or included
346dcafc878b Minor changes to match the style guide.
Fred Drake <fdrake@acm.org>
parents: 17448
diff changeset
13 as part of an HTTP POST request. The
12223
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 10718
diff changeset
14 encoding scheme is defined in \rfc{1521} (\emph{MIME
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 10718
diff changeset
15 (Multipurpose Internet Mail Extensions) Part One: Mechanisms for
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 10718
diff changeset
16 Specifying and Describing the Format of Internet Message Bodies},
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 10718
diff changeset
17 section 5.2, ``Base64 Content-Transfer-Encoding'') and is used for
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 10718
diff changeset
18 MIME email and various other Internet-related applications; it is not
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 10718
diff changeset
19 the same as the output produced by the \program{uuencode} program.
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 10718
diff changeset
20 For example, the string \code{'www.python.org'} is encoded as the
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 10718
diff changeset
21 string \code{'d3d3LnB5dGhvbi5vcmc=\e n'}.
5344
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
22
6689
84b43ff42fa8 Added \indexsubitem definition; functions were previously indexed for the
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
23
7034
ddf52f01bc0a Fixed index entries to be more consistent.
Fred Drake <fdrake@acm.org>
parents: 6689
diff changeset
24 \begin{funcdesc}{decode}{input, output}
5344
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 Decode the contents of the \var{input} file and write the resulting
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 binary data to the \var{output} file.
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 \var{input} and \var{output} must either be file objects or objects that
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 mimic the file object interface. \var{input} will be read until
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 \code{\var{input}.read()} returns an empty string.
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 \end{funcdesc}
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
31
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 \begin{funcdesc}{decodestring}{s}
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 Decode the string \var{s}, which must contain one or more lines of
7788
b1c091501411 Be more specific about where in RFC 1421 to look, since it's not at all
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
34 base64 encoded data, and return a string containing the resulting
5344
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 binary data.
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 \end{funcdesc}
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
37
7034
ddf52f01bc0a Fixed index entries to be more consistent.
Fred Drake <fdrake@acm.org>
parents: 6689
diff changeset
38 \begin{funcdesc}{encode}{input, output}
5344
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 Encode the contents of the \var{input} file and write the resulting
7788
b1c091501411 Be more specific about where in RFC 1421 to look, since it's not at all
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
40 base64 encoded data to the \var{output} file.
5344
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
41 \var{input} and \var{output} must either be file objects or objects that
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
42 mimic the file object interface. \var{input} will be read until
20144
e78c8f4e2b8c State that encode() and encodestring() append a newline to the input data
Fred Drake <fdrake@acm.org>
parents: 18574
diff changeset
43 \code{\var{input}.read()} returns an empty string. If the last input
e78c8f4e2b8c State that encode() and encodestring() append a newline to the input data
Fred Drake <fdrake@acm.org>
parents: 18574
diff changeset
44 character is not a newline (\code{'\e n'}), a newline will be added to
e78c8f4e2b8c State that encode() and encodestring() append a newline to the input data
Fred Drake <fdrake@acm.org>
parents: 18574
diff changeset
45 the input data.
5344
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
46 \end{funcdesc}
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
47
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
48 \begin{funcdesc}{encodestring}{s}
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
49 Encode the string \var{s}, which can contain arbitrary binary data,
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
50 and return a string containing one or more lines of
20144
e78c8f4e2b8c State that encode() and encodestring() append a newline to the input data
Fred Drake <fdrake@acm.org>
parents: 18574
diff changeset
51 base64-encoded data. If the last character of \var{s} is not a
e78c8f4e2b8c State that encode() and encodestring() append a newline to the input data
Fred Drake <fdrake@acm.org>
parents: 18574
diff changeset
52 newline (\code{'\e n'}), a newline will be added. This causes
e78c8f4e2b8c State that encode() and encodestring() append a newline to the input data
Fred Drake <fdrake@acm.org>
parents: 18574
diff changeset
53 \code{encodestring('hello!')} to return the same value as
e78c8f4e2b8c State that encode() and encodestring() append a newline to the input data
Fred Drake <fdrake@acm.org>
parents: 18574
diff changeset
54 \code{encodestring('hello!\e n')}.
5344
9ca27188da23 Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff changeset
55 \end{funcdesc}
10718
fe1e98190af6 Added "See also" sections linking to binascii.
Fred Drake <fdrake@acm.org>
parents: 10255
diff changeset
56
fe1e98190af6 Added "See also" sections linking to binascii.
Fred Drake <fdrake@acm.org>
parents: 10255
diff changeset
57
fe1e98190af6 Added "See also" sections linking to binascii.
Fred Drake <fdrake@acm.org>
parents: 10255
diff changeset
58 \begin{seealso}
21062
bc02c3b09626 Clean up some markup cruft. A number of the macros that take no
Fred Drake <fdrake@acm.org>
parents: 20144
diff changeset
59 \seemodule{binascii}{Support module containing \ASCII-to-binary
15261
bc4f89eefb04 Make all the \seemodule explanations consistent: start with a capitalized
Fred Drake <fdrake@acm.org>
parents: 12223
diff changeset
60 and binary-to-\ASCII{} conversions.}
17448
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 15261
diff changeset
61 \seerfc{1521}{MIME (Multipurpose Internet Mail Extensions) Part One:
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 15261
diff changeset
62 Mechanisms for Specifying and Describing the Format of
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 15261
diff changeset
63 Internet Message Bodies}{Section 5.2, ``Base64
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 15261
diff changeset
64 Content-Transfer-Encoding,'' provides the definition of the
45c1825196ed Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents: 15261
diff changeset
65 base64 encoding.}
10718
fe1e98190af6 Added "See also" sections linking to binascii.
Fred Drake <fdrake@acm.org>
parents: 10255
diff changeset
66 \end{seealso}