home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Languages / Python / python-14-src / Doc / libtraceback.tex / node1_ct.html < prev    next >
LaTeX Document  |  1997-01-17  |  2.5 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
90% dexvert Hypertext Markup Language File (text/html) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file HTML document text default (weak)
99% file LaTeX document text default
98% file exported SGML document text default
97% file exported SGML document, ASCII text default
80% TrID HyperText Markup Language with DOCTYPE default
19% TrID HyperText Markup Language default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% gt2 HTML (Hyper Text Markup Language) Datei default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime text/html default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3c 21 44 4f 43 54 59 50 | 45 20 48 54 4d 4c 20 50 |<!DOCTYP|E HTML P|
|00000010| 55 42 4c 49 43 20 22 2d | 2f 2f 57 33 43 2f 2f 44 |UBLIC "-|//W3C//D|
|00000020| 54 44 20 48 54 4d 4c 20 | 33 2e 32 20 46 69 6e 61 |TD HTML |3.2 Fina|
|00000030| 6c 2f 2f 65 6e 22 3e 0a | 0a 3c 21 2d 2d 43 6f 6e |l//en">.|.<!--Con|
|00000040| 76 65 72 74 65 64 20 77 | 69 74 68 20 4c 61 54 65 |verted w|ith LaTe|
|00000050| 58 32 48 54 4d 4c 20 32 | 30 32 32 20 28 52 65 6c |X2HTML 2|022 (Rel|
|00000060| 65 61 73 65 64 20 4a 61 | 6e 75 61 72 79 20 31 2c |eased Ja|nuary 1,|
|00000070| 20 32 30 32 32 29 20 2d | 2d 3e 0a 3c 48 54 4d 4c | 2022) -|->.<HTML|
|00000080| 20 6c 61 6e 67 3d 22 65 | 6e 22 3e 0a 3c 48 45 41 | lang="e|n">.<HEA|
|00000090| 44 3e 0a 3c 54 49 54 4c | 45 3e 43 6f 6e 74 65 6e |D>.<TITL|E>Conten|
|000000a0| 74 73 20 6f 66 20 53 74 | 61 6e 64 61 72 64 20 4d |ts of St|andard M|
|000000b0| 6f 64 75 6c 65 20 74 72 | 61 63 65 62 61 63 6b 3c |odule tr|aceback<|
|000000c0| 2f 54 49 54 4c 45 3e 0a | 0a 3c 4d 45 54 41 20 48 |/TITLE>.|.<META H|
|000000d0| 54 54 50 2d 45 51 55 49 | 56 3d 22 43 6f 6e 74 65 |TTP-EQUI|V="Conte|
|000000e0| 6e 74 2d 54 79 70 65 22 | 20 43 4f 4e 54 45 4e 54 |nt-Type"| CONTENT|
|000000f0| 3d 22 74 65 78 74 2f 68 | 74 6d 6c 3b 20 63 68 61 |="text/h|tml; cha|
|00000100| 72 73 65 74 3d 75 74 66 | 2d 38 22 3e 0a 3c 4d 45 |rset=utf|-8">.<ME|
|00000110| 54 41 20 4e 41 4d 45 3d | 22 76 69 65 77 70 6f 72 |TA NAME=|"viewpor|
|00000120| 74 22 20 43 4f 4e 54 45 | 4e 54 3d 22 77 69 64 74 |t" CONTE|NT="widt|
|00000130| 68 3d 64 65 76 69 63 65 | 2d 77 69 64 74 68 2c 20 |h=device|-width, |
|00000140| 69 6e 69 74 69 61 6c 2d | 73 63 61 6c 65 3d 31 2e |initial-|scale=1.|
|00000150| 30 22 3e 0a 3c 4d 45 54 | 41 20 4e 41 4d 45 3d 22 |0">.<MET|A NAME="|
|00000160| 47 65 6e 65 72 61 74 6f | 72 22 20 43 4f 4e 54 45 |Generato|r" CONTE|
|00000170| 4e 54 3d 22 4c 61 54 65 | 58 32 48 54 4d 4c 20 76 |NT="LaTe|X2HTML v|
|00000180| 32 30 32 32 22 3e 0a 0a | 3c 4c 49 4e 4b 20 52 45 |2022">..|<LINK RE|
|00000190| 4c 3d 22 53 54 59 4c 45 | 53 48 45 45 54 22 20 48 |L="STYLE|SHEET" H|
|000001a0| 52 45 46 3d 22 6c 69 62 | 74 72 61 63 65 62 61 63 |REF="lib|tracebac|
|000001b0| 6b 2e 63 73 73 22 3e 0a | 0a 3c 4c 49 4e 4b 20 52 |k.css">.|.<LINK R|
|000001c0| 45 4c 3d 22 70 72 65 76 | 69 6f 75 73 22 20 48 52 |EL="prev|ious" HR|
|000001d0| 45 46 3d 22 6c 69 62 74 | 72 61 63 65 62 61 63 6b |EF="libt|raceback|
|000001e0| 5f 6d 6e 2e 68 74 6d 6c | 22 3e 0a 3c 4c 49 4e 4b |_mn.html|">.<LINK|
|000001f0| 20 52 45 4c 3d 22 75 70 | 22 20 48 52 45 46 3d 22 | REL="up|" HREF="|
|00000200| 6c 69 62 74 72 61 63 65 | 62 61 63 6b 5f 6d 6e 2e |libtrace|back_mn.|
|00000210| 68 74 6d 6c 22 3e 0a 3c | 2f 48 45 41 44 3e 0a 20 |html">.<|/HEAD>. |
|00000220| 0a 3c 42 4f 44 59 20 62 | 67 63 6f 6c 6f 72 3d 22 |.<BODY b|gcolor="|
|00000230| 23 66 66 66 66 66 66 22 | 20 74 65 78 74 3d 22 23 |#ffffff"| text="#|
|00000240| 30 30 30 30 30 30 22 20 | 6c 69 6e 6b 3d 22 23 39 |000000" |link="#9|
|00000250| 39 34 34 45 45 22 20 76 | 6c 69 6e 6b 3d 22 23 30 |944EE" v|link="#0|
|00000260| 30 30 30 66 66 22 20 61 | 6c 69 6e 6b 3d 22 23 30 |000ff" a|link="#0|
|00000270| 30 66 66 30 30 22 3e 0a | 0a 3c 48 31 3e 3c 41 20 |0ff00">.|.<H1><A |
|00000280| 49 44 3d 22 53 45 43 54 | 49 4f 4e 30 30 30 31 30 |ID="SECT|ION00010|
|00000290| 30 30 30 30 30 30 30 30 | 30 30 30 30 30 30 30 22 |00000000|0000000"|
|000002a0| 3e 0a 53 74 61 6e 64 61 | 72 64 20 4d 6f 64 75 6c |>.Standa|rd Modul|
|000002b0| 65 20 74 72 61 63 65 62 | 61 63 6b 3c 2f 41 3e 0a |e traceb|ack</A>.|
|000002c0| 3c 2f 48 31 3e 0a 74 72 | 61 63 65 62 61 63 6b 0a |</H1>.tr|aceback.|
|000002d0| 0a 3c 50 3e 0a 0a 3c 50 | 3e 0a 54 68 69 73 20 6d |.<P>..<P|>.This m|
|000002e0| 6f 64 75 6c 65 20 70 72 | 6f 76 69 64 65 73 20 61 |odule pr|ovides a|
|000002f0| 20 73 74 61 6e 64 61 72 | 64 20 69 6e 74 65 72 66 | standar|d interf|
|00000300| 61 63 65 20 74 6f 20 66 | 6f 72 6d 61 74 20 61 6e |ace to f|ormat an|
|00000310| 64 20 70 72 69 6e 74 20 | 73 74 61 63 6b 0a 74 72 |d print |stack.tr|
|00000320| 61 63 65 73 20 6f 66 20 | 50 79 74 68 6f 6e 20 70 |aces of |Python p|
|00000330| 72 6f 67 72 61 6d 73 2e | 20 20 49 74 20 65 78 61 |rograms.| It exa|
|00000340| 63 74 6c 79 20 6d 69 6d | 69 63 73 20 74 68 65 20 |ctly mim|ics the |
|00000350| 62 65 68 61 76 69 6f 72 | 20 6f 66 20 74 68 65 0a |behavior| of the.|
|00000360| 50 79 74 68 6f 6e 20 69 | 6e 74 65 72 70 72 65 74 |Python i|nterpret|
|00000370| 65 72 20 77 68 65 6e 20 | 69 74 20 70 72 69 6e 74 |er when |it print|
|00000380| 73 20 61 20 73 74 61 63 | 6b 20 74 72 61 63 65 2e |s a stac|k trace.|
|00000390| 20 20 54 68 69 73 20 69 | 73 20 75 73 65 66 75 6c | This i|s useful|
|000003a0| 20 77 68 65 6e 0a 79 6f | 75 20 77 61 6e 74 20 74 | when.yo|u want t|
|000003b0| 6f 20 70 72 69 6e 74 20 | 73 74 61 63 6b 20 74 72 |o print |stack tr|
|000003c0| 61 63 65 73 20 75 6e 64 | 65 72 20 70 72 6f 67 72 |aces und|er progr|
|000003d0| 61 6d 20 63 6f 6e 74 72 | 6f 6c 2c 20 65 2e 67 2e |am contr|ol, e.g.|
|000003e0| 20 69 6e 20 61 0a 60 60 | 77 72 61 70 70 65 72 27 | in a.``|wrapper'|
|000003f0| 27 20 61 72 6f 75 6e 64 | 20 74 68 65 20 69 6e 74 |' around| the int|
|00000400| 65 72 70 72 65 74 65 72 | 2e 0a 0a 3c 50 3e 0a 54 |erpreter|...<P>.T|
|00000410| 68 65 20 6d 6f 64 75 6c | 65 20 75 73 65 73 20 74 |he modul|e uses t|
|00000420| 72 61 63 65 62 61 63 6b | 20 6f 62 6a 65 63 74 73 |raceback| objects|
|00000430| 20 26 6d 64 61 73 68 3b | 20 74 68 69 73 20 69 73 | &mdash;| this is|
|00000440| 20 74 68 65 20 6f 62 6a | 65 63 74 20 74 79 70 65 | the obj|ect type|
|00000450| 0a 74 68 61 74 20 69 73 | 20 73 74 6f 72 65 64 20 |.that is| stored |
|00000460| 69 6e 20 74 68 65 20 76 | 61 72 69 61 62 6c 65 73 |in the v|ariables|
|00000470| 20 73 79 73 2e 65 78 63 | 5f 74 72 61 63 65 62 61 | sys.exc|_traceba|
|00000480| 63 6b 20 61 6e 64 0a 73 | 79 73 2e 6c 61 73 74 5f |ck and.s|ys.last_|
|00000490| 74 72 61 63 65 62 61 63 | 6b 2e 0a 0a 3c 50 3e 0a |tracebac|k...<P>.|
|000004a0| 54 68 65 20 6d 6f 64 75 | 6c 65 20 64 65 66 69 6e |The modu|le defin|
|000004b0| 65 73 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |es the f|ollowing|
|000004c0| 20 66 75 6e 63 74 69 6f | 6e 73 3a 0a 0a 3c 50 3e | functio|ns:..<P>|
|000004d0| 0a 3c 42 52 3e 0a 3c 49 | 4d 47 0a 20 20 53 54 59 |.<BR>.<I|MG. STY|
|000004e0| 4c 45 3d 22 68 65 69 67 | 68 74 3a 20 31 39 36 2e |LE="heig|ht: 196.|
|000004f0| 32 35 65 78 3b 20 76 65 | 72 74 69 63 61 6c 2d 61 |25ex; ve|rtical-a|
|00000500| 6c 69 67 6e 3a 20 2d 30 | 2e 35 37 65 78 3b 20 22 |lign: -0|.57ex; "|
|00000510| 20 53 52 43 3d 22 69 6d | 67 31 2e 70 6e 67 22 0a | SRC="im|g1.png".|
|00000520| 20 41 4c 54 3d 22 5c 62 | 65 67 69 6e 7b 66 75 6e | ALT="\b|egin{fun|
|00000530| 63 64 65 73 63 7d 7b 70 | 72 69 6e 74 5f 74 62 7d |cdesc}{p|rint_tb}|
|00000540| 7b 74 72 61 63 65 62 61 | 63 6b 5c 6f 70 74 69 6f |{traceba|ck\optio|
|00000550| 6e 61 6c 7b 5c 2c 20 6c | 69 6d 69 74 7d 7d 0a 50 |nal{\, l|imit}}.P|
|00000560| 72 69 6e 74 20 75 70 20 | 74 6f 20 5c 76 61 72 7b |rint up |to \var{|
|00000570| 6c 69 6d 69 74 7d 2e 2e | 2e 0a 2e 2e 2e 66 0a 5c |limit}..|.....f.\|
|00000580| 76 61 72 7b 6c 69 6d 69 | 74 7d 20 69 73 20 6f 6d |var{limi|t} is om|
|00000590| 69 74 74 65 64 20 6f 72 | 20 5c 63 6f 64 65 7b 4e |itted or| \code{N|
|000005a0| 6f 6e 65 7d 2c 20 61 6c | 6c 20 65 6e 74 72 69 65 |one}, al|l entrie|
|000005b0| 73 20 61 72 65 20 70 72 | 69 6e 74 65 64 2e 0a 5c |s are pr|inted..\|
|000005c0| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 22 3e 0a |end{func|desc}">.|
|000005d0| 3c 42 52 3e 0a 0a 3c 50 | 3e 0a 3c 42 52 3e 0a 3c |<BR>..<P|>.<BR>.<|
|000005e0| 49 4d 47 0a 20 20 53 54 | 59 4c 45 3d 22 68 65 69 |IMG. ST|YLE="hei|
|000005f0| 67 68 74 3a 20 32 2e 31 | 37 65 78 3b 20 76 65 72 |ght: 2.1|7ex; ver|
|00000600| 74 69 63 61 6c 2d 61 6c | 69 67 6e 3a 20 31 37 36 |tical-al|ign: 176|
|00000610| 2e 35 35 65 78 3b 20 22 | 20 53 52 43 3d 22 69 6d |.55ex; "| SRC="im|
|00000620| 67 32 2e 70 6e 67 22 0a | 20 41 4c 54 3d 22 5c 62 |g2.png".| ALT="\b|
|00000630| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 65 |egin{fun|cdesc}{e|
|00000640| 78 74 72 61 63 74 5f 74 | 62 7d 7b 74 72 61 63 65 |xtract_t|b}{trace|
|00000650| 62 61 63 6b 5c 6f 70 74 | 69 6f 6e 61 6c 7b 5c 2c |back\opt|ional{\,|
|00000660| 20 6c 69 6d 69 74 7d 7d | 0a 52 65 74 75 72 6e 20 | limit}}|.Return |
|00000670| 61 20 6c 69 73 74 20 6f | 66 20 75 70 20 74 2e 2e |a list o|f up t..|
|00000680| 2e 0a 2e 2e 2e 73 70 61 | 63 65 20 73 74 72 69 70 |.....spa|ce strip|
|00000690| 70 65 64 3b 20 69 66 20 | 74 68 65 20 73 6f 75 72 |ped; if |the sour|
|000006a0| 63 65 20 69 73 20 6e 6f | 74 20 61 76 61 69 6c 61 |ce is no|t availa|
|000006b0| 62 6c 65 20 69 74 20 69 | 73 0a 5c 63 6f 64 65 7b |ble it i|s.\code{|
|000006c0| 4e 6f 6e 65 7d 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |None}..\|end{func|
|000006d0| 64 65 73 63 7d 22 3e 0a | 3c 42 52 3e 0a 0a 3c 50 |desc}">.|<BR>..<P|
|000006e0| 3e 0a 3c 42 52 3e 0a 3c | 49 4d 47 0a 20 20 53 54 |>.<BR>.<|IMG. ST|
|000006f0| 59 4c 45 3d 22 68 65 69 | 67 68 74 3a 20 32 2e 32 |YLE="hei|ght: 2.2|
|00000700| 34 65 78 3b 20 76 65 72 | 74 69 63 61 6c 2d 61 6c |4ex; ver|tical-al|
|00000710| 69 67 6e 3a 20 31 37 36 | 2e 34 31 65 78 3b 20 22 |ign: 176|.41ex; "|
|00000720| 20 53 52 43 3d 22 69 6d | 67 33 2e 70 6e 67 22 0a | SRC="im|g3.png".|
|00000730| 20 41 4c 54 3d 22 5c 62 | 65 67 69 6e 7b 66 75 6e | ALT="\b|egin{fun|
|00000740| 63 64 65 73 63 7d 7b 70 | 72 69 6e 74 5f 65 78 63 |cdesc}{p|rint_exc|
|00000750| 65 70 74 69 6f 6e 7d 7b | 74 79 70 65 5c 2c 20 76 |eption}{|type\, v|
|00000760| 61 6c 75 65 5c 2c 20 74 | 72 61 63 65 62 61 63 6b |alue\, t|raceback|
|00000770| 5c 6f 70 74 69 6f 6e 61 | 6c 7b 5c 2c 20 6c 69 6d |\optiona|l{\, lim|
|00000780| 69 74 7d 7d 0a 50 2e 2e | 2e 0a 2e 2e 2e 65 64 20 |it}}.P..|.....ed |
|00000790| 77 69 74 68 20 61 0a 63 | 61 72 65 74 20 69 6e 64 |with a.c|aret ind|
|000007a0| 69 63 61 74 69 6f 6e 20 | 74 68 65 20 61 70 70 72 |ication |the appr|
|000007b0| 6f 78 69 6d 61 74 65 20 | 70 6f 73 69 74 69 6f 6e |oximate |position|
|000007c0| 20 6f 66 20 74 68 65 20 | 65 72 72 6f 72 2e 0a 5c | of the |error..\|
|000007d0| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 22 3e 0a |end{func|desc}">.|
|000007e0| 3c 42 52 3e 0a 0a 3c 50 | 3e 0a 3c 42 52 3e 0a 3c |<BR>..<P|>.<BR>.<|
|000007f0| 49 4d 47 0a 20 20 53 54 | 59 4c 45 3d 22 68 65 69 |IMG. ST|YLE="hei|
|00000800| 67 68 74 3a 20 32 2e 31 | 37 65 78 3b 20 76 65 72 |ght: 2.1|7ex; ver|
|00000810| 74 69 63 61 6c 2d 61 6c | 69 67 6e 3a 20 31 37 36 |tical-al|ign: 176|
|00000820| 2e 31 33 65 78 3b 20 22 | 20 53 52 43 3d 22 69 6d |.13ex; "| SRC="im|
|00000830| 67 34 2e 70 6e 67 22 0a | 20 41 4c 54 3d 22 5c 62 |g4.png".| ALT="\b|
|00000840| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 70 |egin{fun|cdesc}{p|
|00000850| 72 69 6e 74 5f 65 78 63 | 7d 7b 5c 6f 70 74 69 6f |rint_exc|}{\optio|
|00000860| 6e 61 6c 7b 6c 69 6d 69 | 74 7d 7d 0a 54 68 69 73 |nal{limi|t}}.This|
|00000870| 20 69 73 20 61 20 73 68 | 6f 72 74 68 61 6e 64 20 | is a sh|orthand |
|00000880| 66 6f 72 20 5c 63 6f 64 | 65 7b 70 72 69 6e 2e 2e |for \cod|e{prin..|
|00000890| 2e 0a 2e 2e 2e 2c 7d 0a | 5c 63 6f 64 65 7b 73 79 |.....,}.|\code{sy|
|000008a0| 73 2e 65 78 63 5f 76 61 | 6c 75 65 2c 7d 20 5c 63 |s.exc_va|lue,} \c|
|000008b0| 6f 64 65 7b 73 79 73 2e | 65 78 63 5f 74 72 61 63 |ode{sys.|exc_trac|
|000008c0| 65 62 61 63 6b 2c 7d 20 | 5c 63 6f 64 65 7b 6c 69 |eback,} |\code{li|
|000008d0| 6d 69 74 29 7d 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |mit)}..\|end{func|
|000008e0| 64 65 73 63 7d 22 3e 0a | 3c 42 52 3e 0a 0a 3c 50 |desc}">.|<BR>..<P|
|000008f0| 3e 0a 3c 42 52 3e 0a 3c | 49 4d 47 0a 20 20 53 54 |>.<BR>.<|IMG. ST|
|00000900| 59 4c 45 3d 22 68 65 69 | 67 68 74 3a 20 32 2e 33 |YLE="hei|ght: 2.3|
|00000910| 38 65 78 3b 20 76 65 72 | 74 69 63 61 6c 2d 61 6c |8ex; ver|tical-al|
|00000920| 69 67 6e 3a 20 31 37 36 | 2e 32 37 65 78 3b 20 22 |ign: 176|.27ex; "|
|00000930| 20 53 52 43 3d 22 69 6d | 67 35 2e 70 6e 67 22 0a | SRC="im|g5.png".|
|00000940| 20 41 4c 54 3d 22 5c 62 | 65 67 69 6e 7b 66 75 6e | ALT="\b|egin{fun|
|00000950| 63 64 65 73 63 7d 7b 70 | 72 69 6e 74 5f 6c 61 73 |cdesc}{p|rint_las|
|00000960| 74 7d 7b 5c 6f 70 74 69 | 6f 6e 61 6c 7b 6c 69 6d |t}{\opti|onal{lim|
|00000970| 69 74 7d 7d 0a 54 68 69 | 73 20 69 73 20 61 20 73 |it}}.Thi|s is a s|
|00000980| 68 6f 72 74 68 61 6e 64 | 20 66 6f 72 20 5c 63 6f |horthand| for \co|
|00000990| 64 65 7b 70 72 69 2e 2e | 2e 0a 2e 2e 2e 0a 5c 63 |de{pri..|......\c|
|000009a0| 6f 64 65 7b 73 79 73 2e | 6c 61 73 74 5f 76 61 6c |ode{sys.|last_val|
|000009b0| 75 65 2c 7d 20 5c 63 6f | 64 65 7b 73 79 73 2e 6c |ue,} \co|de{sys.l|
|000009c0| 61 73 74 5f 74 72 61 63 | 65 62 61 63 6b 2c 7d 20 |ast_trac|eback,} |
|000009d0| 5c 63 6f 64 65 7b 6c 69 | 6d 69 74 29 7d 2e 0a 5c |\code{li|mit)}..\|
|000009e0| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 22 3e 0a |end{func|desc}">.|
|000009f0| 3c 42 52 3e 0a 3c 48 52 | 3e 0a 0a 3c 2f 42 4f 44 |<BR>.<HR|>..</BOD|
|00000a00| 59 3e 0a 3c 2f 48 54 4d | 4c 3e 0a |Y>.</HTM|L>. |
+--------+-------------------------+-------------------------+--------+--------+