home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / source code / Doc / libtemplate.tex / libtemplate.txt
LaTeX Document  |  1995-12-17  |  4.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% gt2 Textdatei (UNIX) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 20 54 65 6d 70 6c 61 | 74 65 20 66 6f 72 20 61 |% Templa|te for a|
|00000010| 20 6c 69 62 72 61 72 79 | 20 6d 61 6e 75 61 6c 20 | library| manual |
|00000020| 73 65 63 74 69 6f 6e 2e | 0a 25 20 50 4c 45 41 53 |section.|.% PLEAS|
|00000030| 45 20 52 45 4d 4f 56 45 | 20 54 48 45 20 43 4f 4d |E REMOVE| THE COM|
|00000040| 4d 45 4e 54 53 20 41 46 | 54 45 52 20 55 53 49 4e |MENTS AF|TER USIN|
|00000050| 47 20 54 48 45 20 54 45 | 4d 50 4c 41 54 45 0a 25 |G THE TE|MPLATE.%|
|00000060| 20 3d 3d 3d 3d 20 31 2e | 20 3d 3d 3d 3d 0a 25 20 | ==== 1.| ====.% |
|00000070| 43 68 6f 6f 73 65 20 6f | 6e 65 20 6f 66 20 74 68 |Choose o|ne of th|
|00000080| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 73 65 63 74 |e follow|ing sect|
|00000090| 69 6f 6e 20 68 65 61 64 | 65 72 73 20 61 6e 64 20 |ion head|ers and |
|000000a0| 69 6e 64 65 78 20 65 6e | 74 72 69 65 73 3b 0a 25 |index en|tries;.%|
|000000b0| 20 5c 73 65 63 74 69 6f | 6e 7b 7d 20 67 65 6e 65 | \sectio|n{} gene|
|000000c0| 72 61 74 65 73 20 74 68 | 65 20 73 65 63 74 69 6f |rates th|e sectio|
|000000d0| 6e 20 68 65 61 64 65 72 | 2c 0a 25 20 5c 62 69 6d |n header|,.% \bim|
|000000e0| 6f 64 69 6e 64 65 78 7b | 7d 20 6f 72 20 5c 73 74 |odindex{|} or \st|
|000000f0| 6d 6f 64 75 6e 64 65 78 | 7b 7d 20 67 65 6e 65 72 |modundex|{} gener|
|00000100| 61 74 65 73 20 61 6e 20 | 69 6e 64 65 78 20 65 6e |ates an |index en|
|00000110| 74 72 79 20 66 6f 72 20 | 74 68 69 73 20 6d 6f 64 |try for |this mod|
|00000120| 75 6c 65 0a 5c 73 65 63 | 74 69 6f 6e 7b 42 75 69 |ule.\sec|tion{Bui|
|00000130| 6c 74 2d 69 6e 20 4d 6f | 64 75 6c 65 20 5c 73 65 |lt-in Mo|dule \se|
|00000140| 63 74 63 6f 64 65 7b 73 | 70 61 6d 7d 7d 09 25 20 |ctcode{s|pam}}.% |
|00000150| 49 66 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 20 69 |If imple|mented i|
|00000160| 6e 20 43 0a 5c 62 69 6d | 6f 64 69 6e 64 65 78 7b |n C.\bim|odindex{|
|00000170| 73 70 61 6d 7d 0a 5c 73 | 65 63 74 69 6f 6e 7b 53 |spam}.\s|ection{S|
|00000180| 74 61 6e 64 61 72 64 20 | 6d 6f 64 75 6c 65 20 5c |tandard |module \|
|00000190| 73 65 63 74 63 6f 64 65 | 7b 73 70 61 6d 7d 7d 09 |sectcode|{spam}}.|
|000001a0| 25 20 49 66 20 69 6d 70 | 6c 65 6d 65 6e 74 65 64 |% If imp|lemented|
|000001b0| 20 69 6e 20 50 79 74 68 | 6f 6e 0a 5c 73 74 6d 6f | in Pyth|on.\stmo|
|000001c0| 64 69 6e 64 65 78 7b 73 | 70 61 6d 7d 0a 25 20 3d |dindex{s|pam}.% =|
|000001d0| 3d 3d 3d 20 32 2e 20 3d | 3d 3d 3d 0a 25 20 47 69 |=== 2. =|===.% Gi|
|000001e0| 76 65 20 61 20 73 68 6f | 72 74 20 6f 76 65 72 76 |ve a sho|rt overv|
|000001f0| 69 65 77 20 6f 66 20 77 | 68 61 74 20 74 68 65 20 |iew of w|hat the |
|00000200| 6d 6f 64 75 6c 65 20 64 | 6f 65 73 2e 0a 25 20 49 |module d|oes..% I|
|00000210| 66 20 69 74 20 69 73 20 | 70 6c 61 74 66 6f 72 6d |f it is |platform|
|00000220| 20 73 70 65 63 69 66 69 | 63 2c 20 6d 65 6e 74 69 | specifi|c, menti|
|00000230| 6f 6e 20 74 68 69 73 2e | 0a 25 20 4d 65 6e 74 69 |on this.|.% Menti|
|00000240| 6f 6e 20 6f 74 68 65 72 | 20 69 6d 70 6f 72 74 61 |on other| importa|
|00000250| 6e 74 20 72 65 73 74 72 | 69 63 74 69 6f 6e 73 20 |nt restr|ictions |
|00000260| 6f 72 20 67 65 6e 65 72 | 61 6c 20 6f 70 65 72 61 |or gener|al opera|
|00000270| 74 69 6e 67 20 70 72 69 | 6e 63 69 70 6c 65 73 2e |ting pri|nciples.|
|00000280| 0a 25 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 3a 0a |.% For e|xample:.|
|00000290| 54 68 65 20 5c 63 6f 64 | 65 7b 73 70 61 6d 7d 20 |The \cod|e{spam} |
|000002a0| 6d 6f 64 75 6c 65 20 64 | 65 66 69 6e 65 73 20 6f |module d|efines o|
|000002b0| 70 65 72 61 74 69 6f 6e | 73 20 66 6f 72 20 68 61 |peration|s for ha|
|000002c0| 6e 64 6c 69 6e 67 20 63 | 61 6e 73 20 6f 66 20 53 |ndling c|ans of S|
|000002d0| 70 61 6d 2e 0a 49 74 20 | 6b 6e 6f 77 73 20 74 68 |pam..It |knows th|
|000002e0| 65 20 66 6f 75 72 20 67 | 65 6e 65 72 61 6c 6c 79 |e four g|enerally|
|000002f0| 20 61 76 61 69 6c 61 62 | 6c 65 20 53 70 61 6d 20 | availab|le Spam |
|00000300| 76 61 72 69 65 74 69 65 | 73 20 61 6e 64 20 75 6e |varietie|s and un|
|00000310| 64 65 72 73 74 61 6e 64 | 73 0a 62 6f 74 68 20 63 |derstand|s.both c|
|00000320| 61 6e 20 73 69 7a 65 73 | 2e 0a 42 65 63 61 75 73 |an sizes|..Becaus|
|00000330| 65 20 73 70 61 6d 69 66 | 69 63 61 74 69 6f 6e 20 |e spamif|ication |
|00000340| 72 65 71 75 69 72 65 73 | 20 55 4e 49 58 20 70 72 |requires| UNIX pr|
|00000350| 6f 63 65 73 73 20 6d 61 | 6e 61 67 65 6d 65 6e 74 |ocess ma|nagement|
|00000360| 2c 20 74 68 65 20 6d 6f | 64 75 6c 65 20 69 73 0a |, the mo|dule is.|
|00000370| 6f 6e 6c 79 20 61 76 61 | 69 6c 61 62 6c 65 20 6f |only ava|ilable o|
|00000380| 6e 20 67 65 6e 75 69 6e | 65 20 55 4e 49 58 20 73 |n genuin|e UNIX s|
|00000390| 79 73 74 65 6d 73 2e 0a | 25 20 3d 3d 3d 3d 20 33 |ystems..|% ==== 3|
|000003a0| 2e 20 3d 3d 3d 3d 0a 25 | 20 4c 69 73 74 20 74 68 |. ====.%| List th|
|000003b0| 65 20 70 75 62 6c 69 63 | 20 66 75 6e 63 74 69 6f |e public| functio|
|000003c0| 6e 73 20 64 65 66 69 6e | 65 64 20 62 79 20 74 68 |ns defin|ed by th|
|000003d0| 65 20 6d 6f 64 75 6c 65 | 2e 20 20 42 65 67 69 6e |e module|. Begin|
|000003e0| 20 77 69 74 68 20 61 0a | 25 20 73 74 61 6e 64 61 | with a.|% standa|
|000003f0| 72 64 20 70 68 72 61 73 | 65 2e 20 20 59 6f 75 20 |rd phras|e. You |
|00000400| 6d 61 79 20 61 6c 73 6f | 20 6c 69 73 74 20 74 68 |may also| list th|
|00000410| 65 20 65 78 63 65 70 74 | 69 6f 6e 73 20 61 6e 64 |e except|ions and|
|00000420| 20 6f 74 68 65 72 20 64 | 61 74 61 0a 25 20 69 74 | other d|ata.% it|
|00000430| 65 6d 73 20 64 65 66 69 | 6e 65 64 20 69 6e 20 74 |ems defi|ned in t|
|00000440| 68 65 20 6d 6f 64 75 6c | 65 2c 20 69 6e 73 6f 66 |he modul|e, insof|
|00000450| 61 72 20 61 73 20 74 68 | 65 79 20 61 72 65 20 69 |ar as th|ey are i|
|00000460| 6d 70 6f 72 74 61 6e 74 | 20 66 6f 72 20 74 68 65 |mportant| for the|
|00000470| 0a 25 20 75 73 65 72 2e | 0a 54 68 65 20 5c 63 6f |.% user.|.The \co|
|00000480| 64 65 7b 73 70 61 6d 7d | 20 6d 6f 64 75 6c 65 20 |de{spam}| module |
|00000490| 64 65 66 69 6e 65 73 20 | 74 68 65 20 66 6f 6c 6c |defines |the foll|
|000004a0| 6f 77 69 6e 67 20 66 75 | 6e 63 74 69 6f 6e 73 3a |owing fu|nctions:|
|000004b0| 0a 25 20 2d 2d 2d 2d 20 | 33 2e 31 2e 20 2d 2d 2d |.% ---- |3.1. ---|
|000004c0| 2d 0a 25 20 52 65 64 65 | 66 69 6e 65 20 74 68 65 |-.% Rede|fine the|
|000004d0| 20 60 60 69 6e 64 65 78 | 73 75 62 69 74 65 6d 27 | ``index|subitem'|
|000004e0| 27 20 6d 61 63 72 6f 20 | 74 6f 20 70 6f 69 6e 74 |' macro |to point|
|000004f0| 20 74 6f 20 74 68 69 73 | 20 6d 6f 64 75 6c 65 0a | to this| module.|
|00000500| 25 20 28 61 6c 74 65 72 | 6e 61 74 69 76 65 6c 79 |% (alter|natively|
|00000510| 2c 20 79 6f 75 20 63 61 | 6e 20 70 75 74 20 74 68 |, you ca|n put th|
|00000520| 69 73 20 61 74 20 74 68 | 65 20 74 6f 70 20 6f 66 |is at th|e top of|
|00000530| 20 74 68 65 20 66 69 6c | 65 29 3a 0a 5c 72 65 6e | the fil|e):.\ren|
|00000540| 65 77 63 6f 6d 6d 61 6e | 64 7b 5c 69 6e 64 65 78 |ewcomman|d{\index|
|00000550| 73 75 62 69 74 65 6d 7d | 7b 28 69 6e 20 6d 6f 64 |subitem}|{(in mod|
|00000560| 75 6c 65 20 73 70 61 6d | 29 7d 0a 25 20 2d 2d 2d |ule spam|)}.% ---|
|00000570| 2d 20 33 2e 32 2e 20 2d | 2d 2d 2d 0a 25 20 46 6f |- 3.2. -|---.% Fo|
|00000580| 72 20 65 61 63 68 20 66 | 75 6e 63 74 69 6f 6e 2c |r each f|unction,|
|00000590| 20 75 73 65 20 61 20 60 | 60 66 75 6e 63 64 65 73 | use a `|`funcdes|
|000005a0| 63 27 27 20 62 6c 6f 63 | 6b 2e 20 20 54 68 69 73 |c'' bloc|k. This|
|000005b0| 20 68 61 73 20 65 78 61 | 63 74 6c 79 20 74 77 6f | has exa|ctly two|
|000005c0| 0a 25 20 70 61 72 61 6d | 65 74 65 72 73 20 28 65 |.% param|eters (e|
|000005d0| 61 63 68 20 70 61 72 61 | 6d 65 74 65 72 73 20 69 |ach para|meters i|
|000005e0| 73 20 63 6f 6e 74 61 69 | 6e 65 64 20 69 6e 20 61 |s contai|ned in a|
|000005f0| 20 73 65 74 20 6f 66 20 | 63 75 72 6c 79 20 62 72 | set of |curly br|
|00000600| 61 63 65 73 29 3a 0a 25 | 20 74 68 65 20 66 69 72 |aces):.%| the fir|
|00000610| 73 74 20 70 61 72 61 6d | 65 74 65 72 20 69 73 20 |st param|eter is |
|00000620| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 20 6e 61 6d |the func|tion nam|
|00000630| 65 20 28 74 68 69 73 20 | 61 75 74 6f 6d 61 74 69 |e (this |automati|
|00000640| 63 61 6c 6c 79 0a 25 20 | 67 65 6e 65 72 61 74 65 |cally.% |generate|
|00000650| 73 20 61 6e 20 69 6e 64 | 65 78 20 65 6e 74 72 79 |s an ind|ex entry|
|00000660| 29 3b 20 74 68 65 20 73 | 65 63 6f 6e 64 20 70 61 |); the s|econd pa|
|00000670| 72 61 6d 65 74 65 72 20 | 69 73 20 74 68 65 20 66 |rameter |is the f|
|00000680| 75 6e 63 74 69 6f 6e 27 | 73 0a 25 20 61 72 67 75 |unction'|s.% argu|
|00000690| 6d 65 6e 74 20 6c 69 73 | 74 2e 20 20 49 66 20 74 |ment lis|t. If t|
|000006a0| 68 65 72 65 20 61 72 65 | 20 6e 6f 20 61 72 67 75 |here are| no argu|
|000006b0| 6d 65 6e 74 73 2c 20 75 | 73 65 20 61 6e 20 65 6d |ments, u|se an em|
|000006c0| 70 74 79 20 70 61 69 72 | 20 6f 66 0a 25 20 63 75 |pty pair| of.% cu|
|000006d0| 72 6c 79 20 62 72 61 63 | 65 73 2e 20 20 49 66 20 |rly brac|es. If |
|000006e0| 74 68 65 72 65 20 69 73 | 20 6d 6f 72 65 20 74 68 |there is| more th|
|000006f0| 61 6e 20 6f 6e 65 20 61 | 72 67 75 6d 65 6e 74 2c |an one a|rgument,|
|00000700| 20 73 65 70 61 72 61 74 | 65 20 74 68 65 0a 25 20 | separat|e the.% |
|00000710| 61 72 67 75 6d 65 6e 74 | 73 20 77 69 74 68 20 62 |argument|s with b|
|00000720| 61 63 6b 73 6c 61 73 68 | 2d 63 6f 6d 6d 61 2e 20 |ackslash|-comma. |
|00000730| 20 4f 70 74 69 6f 6e 61 | 6c 20 70 61 72 74 73 20 | Optiona|l parts |
|00000740| 6f 66 20 74 68 65 20 70 | 61 72 61 6d 65 74 65 72 |of the p|arameter|
|00000750| 0a 25 20 6c 69 73 74 20 | 61 72 65 20 63 6f 6e 74 |.% list |are cont|
|00000760| 61 69 6e 65 64 20 69 6e | 20 5c 6f 70 74 69 6f 6e |ained in| \option|
|00000770| 61 6c 7b 2e 2e 2e 7d 20 | 28 74 68 69 73 20 67 65 |al{...} |(this ge|
|00000780| 6e 65 72 61 74 65 73 20 | 61 20 73 65 74 20 6f 66 |nerates |a set of|
|00000790| 20 73 71 75 61 72 65 0a | 25 20 62 72 61 63 6b 65 | square.|% bracke|
|000007a0| 74 73 20 61 72 6f 75 6e | 64 20 69 74 73 20 70 61 |ts aroun|d its pa|
|000007b0| 72 61 6d 65 74 65 72 29 | 2e 20 20 41 72 67 75 6d |rameter)|. Argum|
|000007c0| 65 6e 74 73 20 61 72 65 | 20 61 75 74 6f 6d 61 74 |ents are| automat|
|000007d0| 69 63 61 6c 6c 79 20 73 | 65 74 20 69 6e 0a 25 20 |ically s|et in.% |
|000007e0| 69 74 61 6c 69 63 73 20 | 69 6e 20 74 68 65 20 70 |italics |in the p|
|000007f0| 61 72 61 6d 65 74 65 72 | 20 6c 69 73 74 2e 20 20 |arameter| list. |
|00000800| 45 61 63 68 20 61 72 67 | 75 6d 65 6e 74 20 73 68 |Each arg|ument sh|
|00000810| 6f 75 6c 64 20 62 65 20 | 6d 65 6e 74 69 6f 6e 65 |ould be |mentione|
|00000820| 64 20 61 74 0a 25 20 6c | 65 61 73 74 20 6f 6e 63 |d at.% l|east onc|
|00000830| 65 20 69 6e 20 74 68 65 | 20 64 65 73 63 72 69 70 |e in the| descrip|
|00000840| 74 69 6f 6e 3b 20 65 61 | 63 68 20 75 73 61 67 65 |tion; ea|ch usage|
|00000850| 20 28 65 76 65 6e 20 69 | 6e 73 69 64 65 20 5c 63 | (even i|nside \c|
|00000860| 6f 64 65 7b 2e 2e 2e 7d | 29 0a 25 20 73 68 6f 75 |ode{...}|).% shou|
|00000870| 6c 64 20 62 65 20 65 6e | 63 6c 6f 73 65 64 20 69 |ld be en|closed i|
|00000880| 6e 20 5c 76 61 72 7b 2e | 2e 2e 7d 2e 0a 5c 62 65 |n \var{.|..}..\be|
|00000890| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 6f 70 |gin{func|desc}{op|
|000008a0| 65 6e 7d 7b 66 69 6c 65 | 6e 61 6d 65 5c 6f 70 74 |en}{file|name\opt|
|000008b0| 69 6f 6e 61 6c 7b 5c 2c | 20 6d 6f 64 65 5c 2c 20 |ional{\,| mode\, |
|000008c0| 62 75 66 66 65 72 73 69 | 7a 65 7d 7d 0a 4f 70 65 |buffersi|ze}}.Ope|
|000008d0| 6e 20 74 68 65 20 66 69 | 6c 65 20 5c 76 61 72 7b |n the fi|le \var{|
|000008e0| 66 69 6c 65 6e 61 6d 65 | 7d 20 61 73 20 61 20 63 |filename|} as a c|
|000008f0| 61 6e 20 6f 66 20 53 70 | 61 6d 2e 20 20 54 68 65 |an of Sp|am. The|
|00000900| 20 6f 70 74 69 6f 6e 61 | 6c 0a 5c 76 61 72 7b 6d | optiona|l.\var{m|
|00000910| 6f 64 65 7d 20 61 6e 64 | 20 5c 76 61 72 7b 62 75 |ode} and| \var{bu|
|00000920| 66 66 65 72 73 69 7a 65 | 7d 20 61 72 67 75 6d 65 |ffersize|} argume|
|00000930| 6e 74 73 20 73 70 65 63 | 69 66 79 20 74 68 65 20 |nts spec|ify the |
|00000940| 72 65 61 64 2d 77 72 69 | 74 65 20 6d 6f 64 65 0a |read-wri|te mode.|
|00000950| 28 5c 63 6f 64 65 7b 27 | 72 27 7d 20 28 64 65 66 |(\code{'|r'} (def|
|00000960| 61 75 6c 74 29 20 6f 72 | 20 5c 63 6f 64 65 7b 27 |ault) or| \code{'|
|00000970| 77 27 7d 29 20 61 6e 64 | 20 74 68 65 20 62 75 66 |w'}) and| the buf|
|00000980| 66 65 72 20 73 69 7a 65 | 20 28 64 65 66 61 75 6c |fer size| (defaul|
|00000990| 74 3a 0a 73 79 73 74 65 | 6d 20 64 65 70 65 6e 64 |t:.syste|m depend|
|000009a0| 65 6e 74 29 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |ent)..\e|nd{funcd|
|000009b0| 65 73 63 7d 0a 25 20 2d | 2d 2d 2d 20 33 2e 33 2e |esc}.% -|--- 3.3.|
|000009c0| 20 2d 2d 2d 2d 0a 25 20 | 44 61 74 61 20 69 74 65 | ----.% |Data ite|
|000009d0| 6d 73 20 61 72 65 20 64 | 65 73 63 72 69 62 65 64 |ms are d|escribed|
|000009e0| 20 75 73 69 6e 67 20 61 | 20 60 60 64 61 74 61 64 | using a| ``datad|
|000009f0| 65 73 63 27 27 20 62 6c | 6f 63 6b 2e 20 20 54 68 |esc'' bl|ock. Th|
|00000a00| 69 73 20 68 61 73 20 6f | 6e 6c 79 0a 25 20 6f 6e |is has o|nly.% on|
|00000a10| 65 20 70 61 72 61 6d 65 | 74 65 72 3a 20 74 68 65 |e parame|ter: the|
|00000a20| 20 69 74 65 6d 27 73 20 | 6e 61 6d 65 2e 0a 5c 62 | item's |name..\b|
|00000a30| 65 67 69 6e 7b 64 61 74 | 61 64 65 73 63 7d 7b 63 |egin{dat|adesc}{c|
|00000a40| 61 6e 73 69 7a 65 7d 0a | 54 68 65 20 64 65 66 61 |ansize}.|The defa|
|00000a50| 75 6c 74 20 63 61 6e 20 | 73 69 7a 65 2c 20 69 6e |ult can |size, in|
|00000a60| 20 6f 75 6e 63 65 73 2e | 20 20 4c 65 67 61 6c 20 | ounces.| Legal |
|00000a70| 76 61 6c 75 65 73 20 61 | 72 65 20 37 20 61 6e 64 |values a|re 7 and|
|00000a80| 20 31 32 2e 20 20 54 68 | 65 0a 64 65 66 61 75 6c | 12. Th|e.defaul|
|00000a90| 74 20 76 61 72 69 65 73 | 20 70 65 72 20 73 75 70 |t varies| per sup|
|00000aa0| 65 72 6d 61 72 6b 65 74 | 2e 20 20 54 68 69 73 20 |ermarket|. This |
|00000ab0| 76 61 72 69 61 62 6c 65 | 20 73 68 6f 75 6c 64 20 |variable| should |
|00000ac0| 6e 6f 74 20 62 65 20 63 | 68 61 6e 67 65 64 0a 6f |not be c|hanged.o|
|00000ad0| 6e 63 65 20 74 68 65 20 | 5c 63 6f 64 65 7b 6f 70 |nce the |\code{op|
|00000ae0| 65 6e 28 29 7d 20 66 75 | 6e 63 74 69 6f 6e 20 68 |en()} fu|nction h|
|00000af0| 61 73 20 62 65 65 6e 20 | 63 61 6c 6c 65 64 2e 0a |as been |called..|
|00000b00| 5c 65 6e 64 7b 64 61 74 | 61 64 65 73 63 7d 0a 25 |\end{dat|adesc}.%|
|00000b10| 20 2d 2d 2d 20 33 2e 34 | 2e 20 2d 2d 2d 0a 25 20 | --- 3.4|. ---.% |
|00000b20| 45 78 63 65 70 74 69 6f | 6e 73 20 61 72 65 20 64 |Exceptio|ns are d|
|00000b30| 65 73 63 72 69 62 65 64 | 20 75 73 69 6e 67 20 61 |escribed| using a|
|00000b40| 20 60 60 65 78 63 64 65 | 73 63 27 27 20 62 6c 6f | ``excde|sc'' blo|
|00000b50| 63 6b 2e 20 20 54 68 69 | 73 20 68 61 73 20 6f 6e |ck. Thi|s has on|
|00000b60| 6c 79 0a 25 20 6f 6e 65 | 20 70 61 72 61 6d 65 74 |ly.% one| paramet|
|00000b70| 65 72 3a 20 74 68 65 20 | 65 78 63 65 70 74 69 6f |er: the |exceptio|
|00000b80| 6e 20 6e 61 6d 65 2e 0a | 5c 62 65 67 69 6e 7b 65 |n name..|\begin{e|
|00000b90| 78 63 64 65 73 63 7d 7b | 65 72 72 6f 72 7d 0a 45 |xcdesc}{|error}.E|
|00000ba0| 78 63 65 70 74 69 6f 6e | 20 72 61 69 73 65 64 20 |xception| raised |
|00000bb0| 77 68 65 6e 20 61 6e 20 | 6f 70 65 72 61 74 69 6f |when an |operatio|
|00000bc0| 6e 20 66 61 69 6c 73 20 | 66 6f 72 20 61 20 53 70 |n fails |for a Sp|
|00000bd0| 61 6d 20 73 70 65 63 69 | 66 69 63 20 72 65 61 73 |am speci|fic reas|
|00000be0| 6f 6e 2e 0a 54 68 65 20 | 65 78 63 65 70 74 69 6f |on..The |exceptio|
|00000bf0| 6e 20 61 72 67 75 6d 65 | 6e 74 20 69 73 20 61 20 |n argume|nt is a |
|00000c00| 73 74 72 69 6e 67 20 64 | 65 73 63 72 69 62 69 6e |string d|escribin|
|00000c10| 67 20 74 68 65 20 72 65 | 61 73 6f 6e 20 6f 66 20 |g the re|ason of |
|00000c20| 74 68 65 0a 66 61 69 6c | 75 72 65 2e 0a 5c 65 6e |the.fail|ure..\en|
|00000c30| 64 7b 65 78 63 64 65 73 | 63 7d 0a 25 20 2d 2d 2d |d{excdes|c}.% ---|
|00000c40| 2d 20 33 2e 35 2e 20 2d | 2d 2d 2d 0a 25 20 54 68 |- 3.5. -|---.% Th|
|00000c50| 65 72 65 20 69 73 20 6e | 6f 20 73 74 61 6e 64 61 |ere is n|o standa|
|00000c60| 72 64 20 62 6c 6f 63 6b | 20 74 79 70 65 20 66 6f |rd block| type fo|
|00000c70| 72 20 63 6c 61 73 73 65 | 73 2e 20 20 49 20 67 65 |r classe|s. I ge|
|00000c80| 6e 65 72 61 6c 6c 79 20 | 75 73 65 0a 25 20 60 60 |nerally |use.% ``|
|00000c90| 66 75 6e 63 64 65 73 63 | 27 27 20 62 6c 6f 63 6b |funcdesc|'' block|
|00000ca0| 73 2c 20 73 69 6e 63 65 | 20 63 6c 61 73 73 20 69 |s, since| class i|
|00000cb0| 6e 73 74 61 6e 74 69 61 | 74 69 6f 6e 20 6c 6f 6f |nstantia|tion loo|
|00000cc0| 6b 73 20 76 65 72 79 20 | 6d 75 63 68 20 6c 69 6b |ks very |much lik|
|00000cd0| 65 0a 25 20 61 20 66 75 | 6e 63 74 69 6f 6e 20 63 |e.% a fu|nction c|
|00000ce0| 61 6c 6c 2e 0a 25 20 3d | 3d 3d 3d 20 34 2e 20 3d |all..% =|=== 4. =|
|00000cf0| 3d 3d 3d 0a 25 20 4e 6f | 77 20 69 73 20 70 72 6f |===.% No|w is pro|
|00000d00| 62 61 62 6c 79 20 61 20 | 67 6f 6f 64 20 74 69 6d |bably a |good tim|
|00000d10| 65 20 66 6f 72 20 61 20 | 63 6f 6d 70 6c 65 74 65 |e for a |complete|
|00000d20| 20 65 78 61 6d 70 6c 65 | 2e 20 20 28 41 6c 74 65 | example|. (Alte|
|00000d30| 72 6e 61 74 69 76 65 6c | 79 2c 0a 25 20 61 6e 20 |rnativel|y,.% an |
|00000d40| 65 78 61 6d 70 6c 65 20 | 67 69 76 69 6e 67 20 74 |example |giving t|
|00000d50| 68 65 20 66 6c 61 76 6f | 72 20 6f 66 20 74 68 65 |he flavo|r of the|
|00000d60| 20 6d 6f 64 75 6c 65 20 | 6d 61 79 20 62 65 20 67 | module |may be g|
|00000d70| 69 76 65 6e 20 62 65 66 | 6f 72 65 20 74 68 65 0a |iven bef|ore the.|
|00000d80| 25 20 64 65 74 61 69 6c | 65 64 20 6c 69 73 74 20 |% detail|ed list |
|00000d90| 6f 66 20 66 75 6e 63 74 | 69 6f 6e 73 2e 29 0a 45 |of funct|ions.).E|
|00000da0| 78 61 6d 70 6c 65 3a 0a | 5c 62 65 67 69 6e 7b 76 |xample:.|\begin{v|
|00000db0| 65 72 62 61 74 69 6d 7d | 0a 3e 3e 3e 20 69 6d 70 |erbatim}|.>>> imp|
|00000dc0| 6f 72 74 20 73 70 61 6d | 0a 3e 3e 3e 20 63 61 6e |ort spam|.>>> can|
|00000dd0| 20 3d 20 73 70 61 6d 2e | 6f 70 65 6e 28 27 2f 65 | = spam.|open('/e|
|00000de0| 74 63 2f 70 61 73 73 77 | 64 27 29 0a 3e 3e 3e 20 |tc/passw|d').>>> |
|00000df0| 63 61 6e 2e 65 6d 70 74 | 79 28 29 0a 3e 3e 3e 20 |can.empt|y().>>> |
|00000e00| 63 61 6e 2e 63 6c 6f 73 | 65 28 29 0a 5c 65 6e 64 |can.clos|e().\end|
|00000e10| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 25 20 3d 3d 3d |{verbati|m}.% ===|
|00000e20| 3d 20 35 2e 20 3d 3d 3d | 3d 0a 25 20 49 66 20 79 |= 5. ===|=.% If y|
|00000e30| 6f 75 72 20 6d 6f 64 75 | 6c 65 20 64 65 66 69 6e |our modu|le defin|
|00000e40| 65 73 20 6e 65 77 20 6f | 62 6a 65 63 74 20 74 79 |es new o|bject ty|
|00000e50| 70 65 73 20 28 66 6f 72 | 20 61 20 62 75 69 6c 74 |pes (for| a built|
|00000e60| 2d 69 6e 20 6d 6f 64 75 | 6c 65 29 20 6f 72 0a 25 |-in modu|le) or.%|
|00000e70| 20 63 6c 61 73 73 65 73 | 20 28 66 6f 72 20 61 20 | classes| (for a |
|00000e80| 6d 6f 64 75 6c 65 20 77 | 72 69 74 74 65 6e 20 69 |module w|ritten i|
|00000e90| 6e 20 50 79 74 68 6f 6e | 29 2c 20 79 6f 75 20 73 |n Python|), you s|
|00000ea0| 68 6f 75 6c 64 20 6c 69 | 73 74 20 74 68 65 0a 25 |hould li|st the.%|
|00000eb0| 20 6d 65 74 68 6f 64 73 | 20 61 6e 64 20 69 6e 73 | methods| and ins|
|00000ec0| 74 61 6e 63 65 20 76 61 | 72 69 61 62 6c 65 73 20 |tance va|riables |
|00000ed0| 28 69 66 20 61 6e 79 29 | 20 6f 66 20 65 61 63 68 |(if any)| of each|
|00000ee0| 20 74 79 70 65 20 6f 72 | 20 63 6c 61 73 73 20 69 | type or| class i|
|00000ef0| 6e 20 61 0a 25 20 73 65 | 70 61 72 61 74 65 20 73 |n a.% se|parate s|
|00000f00| 75 62 73 65 63 74 69 6f | 6e 2e 20 20 49 74 20 69 |ubsectio|n. It i|
|00000f10| 73 20 69 6d 70 6f 72 74 | 61 6e 74 20 74 6f 20 72 |s import|ant to r|
|00000f20| 65 64 65 66 69 6e 65 20 | 60 60 69 6e 64 65 78 73 |edefine |``indexs|
|00000f30| 75 62 69 74 65 6d 27 27 | 0a 25 20 66 6f 72 20 65 |ubitem''|.% for e|
|00000f40| 61 63 68 20 73 75 62 73 | 65 63 74 69 6f 6e 2e 0a |ach subs|ection..|
|00000f50| 5c 73 75 62 73 65 63 74 | 69 6f 6e 7b 53 70 61 6d |\subsect|ion{Spam|
|00000f60| 20 4f 62 6a 65 63 74 73 | 7d 0a 53 70 61 6d 20 6f | Objects|}.Spam o|
|00000f70| 62 6a 65 63 74 73 20 28 | 72 65 74 75 72 6e 65 64 |bjects (|returned|
|00000f80| 20 62 79 20 5c 63 6f 64 | 65 7b 6f 70 65 6e 28 29 | by \cod|e{open()|
|00000f90| 7d 20 61 62 6f 76 65 29 | 20 68 61 76 65 20 74 68 |} above)| have th|
|00000fa0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 0a 6d 65 74 68 |e follow|ing.meth|
|00000fb0| 6f 64 73 2e 0a 5c 72 65 | 6e 65 77 63 6f 6d 6d 61 |ods..\re|newcomma|
|00000fc0| 6e 64 7b 5c 69 6e 64 65 | 78 73 75 62 69 74 65 6d |nd{\inde|xsubitem|
|00000fd0| 7d 7b 28 73 70 61 6d 20 | 6d 65 74 68 6f 64 29 7d |}{(spam |method)}|
|00000fe0| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00000ff0| 7d 7b 65 6d 70 74 79 7d | 7b 7d 0a 45 6d 70 74 79 |}{empty}|{}.Empty|
|00001000| 20 74 68 65 20 63 61 6e | 20 69 6e 74 6f 20 74 68 | the can| into th|
|00001010| 65 20 74 72 61 73 68 2e | 0a 5c 65 6e 64 7b 66 75 |e trash.|.\end{fu|
|00001020| 6e 63 64 65 73 63 7d 0a | |ncdesc}.| |
+--------+-------------------------+-------------------------+--------+--------+