diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/thinkpython/tex-zh/.book.tex.swp b/thinkpython/tex-zh/.book.tex.swp deleted file mode 100644 index 8261d04..0000000 Binary files a/thinkpython/tex-zh/.book.tex.swp and /dev/null differ diff --git a/thinkpython/tex-zh/Makefile b/thinkpython/tex-zh/Makefile new file mode 100644 index 0000000..d62fa57 --- /dev/null +++ b/thinkpython/tex-zh/Makefile @@ -0,0 +1,59 @@ +LATEX = latex + +DVIPS = dvips + +PDFFLAGS = -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress \ + -dCompressPages=true -dUseFlateCompression=true \ + -dEmbedAllFonts=true -dSubsetFonts=true -dMaxSubsetPct=100 + + +%.dvi: %.tex + $(LATEX) $< + +%.ps: %.dvi + $(DVIPS) -o $@ $< + +%.pdf: %.ps + ps2pdf $(PDFFLAGS) $< + +all: book.tex + xelatex book + makeindex book + xelatex book +# dvips -t letter -Ppdf -o thinkpython.ps book +# dvips -T 6.75in,9.25in -Ppdf -o thinkpython.ps book +# dvips -t b5 -Ppdf -o thinkpython.ps book +# dvips -T 7in,10in -Ppdf -o thinkpython.ps book +# gv thinkpython.ps + +html: book.tex header.html footer.html + rm -rf html + mkdir html + hevea -O -e latexonly htmlonly book +# the following line is a kludge to prevent imagen from seeing +# the definitions in latexonly + grep -v latexonly book.image.tex > a; mv a book.image.tex + imagen -png book + hacha book.html + cp up.png next.png back.png html + mv index.html book.css book*.html book*.png *motif.gif html + +DEST = /home/downey/public_html/greent/thinkpython + +distrib: + ps2pdf $(PDFFLAGS) thinkpython.ps + rm -rf dist + mkdir dist dist/tex dist/tex/figs + rsync -a thinkpython.pdf thinkpython.ps html dist + rsync -a Makefile book.tex latexonly htmlonly dist/tex + rsync -a figs/*.fig figs/*.eps dist/tex/figs + cd dist; zip -r thinkpython.tex.zip tex + cd dist; zip -r thinkpython.html.zip html + rsync -a dist/* $(DEST) + chmod -R o+r $(DEST)/* + +clean: + rm -f *~ *.aux *.log *.dvi *.idx *.ilg *.ind *.toc *.pdf + + + diff --git a/thinkpython/tex-zh/book.aux b/thinkpython/tex-zh/book.aux deleted file mode 100644 index dd533bc..0000000 --- a/thinkpython/tex-zh/book.aux +++ /dev/null @@ -1,22 +0,0 @@ -\relax -\@writefile{toc}{\contentsline {chapter}{前言}{v}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {0.1}本书的奇怪历史}{v}} -\@writefile{toc}{\contentsline {chapter}{\numberline {1}编程的方式}{1}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {1.1}Python编程语言}{1}} -\@writefile{toc}{\contentsline {section}{\numberline {1.2}什么是程序}{2}} -\@writefile{toc}{\contentsline {section}{\numberline {1.3}什么是调试?}{3}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.1}语法错误}{3}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.2}运行时错误}{3}} -\newlabel{runtime 运行时}{{1.3.2}{3}} -\@writefile{toc}{\contentsline {section}{\numberline {1.4}语义错误}{3}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.4.1}试验性的调试}{3}} -\@writefile{toc}{\contentsline {section}{\numberline {1.5}正式语言和自然语言}{4}} -\@writefile{toc}{\contentsline {section}{\numberline {1.6}第一个程序}{5}} -\newlabel{hello}{{1.6}{5}} -\@writefile{toc}{\contentsline {section}{\numberline {1.7}调试}{6}} -\@writefile{toc}{\contentsline {section}{\numberline {1.8}术语表}{6}} -\@writefile{toc}{\contentsline {section}{\numberline {1.9}练习}{7}} diff --git a/thinkpython/tex-zh/book.idx b/thinkpython/tex-zh/book.idx deleted file mode 100644 index cbc4cb2..0000000 --- a/thinkpython/tex-zh/book.idx +++ /dev/null @@ -1,95 +0,0 @@ -\indexentry{GNU Free Documentation License}{v} -\indexentry{Free Documentation License,GNU}{v} -\indexentry{GNU Free Documentation License}{vi} -\indexentry{Free Documentation License,GNU}{vi} -\indexentry{贡献者}{vii} -\indexentry{解决问题}{1} -\indexentry{编程语言}{1} -\indexentry{语言!编程}{1} -\indexentry{移植性}{1} -\indexentry{高级语言}{1} -\indexentry{低级语言}{1} -\indexentry{语言!高级}{1} -\indexentry{语言!低级}{1} -\indexentry{complie}{1} -\indexentry{interpret}{1} -\indexentry{源码}{2} -\indexentry{目标}{2} -\indexentry{可执行代码}{2} -\indexentry{交互模式}{2} -\indexentry{脚本模式}{2} -\indexentry{提示符}{2} -\indexentry{脚本}{2} -\indexentry{测试!交互模式}{2} -\indexentry{程序}{2} -\indexentry{算法}{3} -\indexentry{调试}{3} -\indexentry{臭虫}{3} -\indexentry{语法错误}{3} -\indexentry{错误!语法}{3} -\indexentry{错误信息}{3} -\indexentry{syntax 语法}{3} -\indexentry{parentheses!matching 括号!匹配}{3} -\indexentry{syntax 语法}{3} -\indexentry{cummings, e. e. 康明思}{3} -\indexentry{runtime error 运行时错误}{3} -\indexentry{error!runtime 错误!运行时}{3} -\indexentry{exception 异常}{3} -\indexentry{safe language 安全语言}{3} -\indexentry{language!safe 语言!安全}{3} -\indexentry{semantics 语义}{3} -\indexentry{semantics errors 语义错误}{3} -\indexentry{error!semantic 错误!语义}{3} -\indexentry{error message 错误信息}{3} -\indexentry{experimental debugging 实验性的调试}{3} -\indexentry{debugging!experimental 调试!实验}{3} -\indexentry{Holems, Sherlock}{4} -\indexentry{Doyle, Arthur Conan}{4} -\indexentry{Linux}{4} -\indexentry{formal language 正式语言}{4} -\indexentry{natural language 自然语言}{4} -\indexentry{language!formal 语言!正式}{4} -\indexentry{language!natural 语言!自然}{4} -\indexentry{token 标记}{4} -\indexentry{structure 结构}{4} -\indexentry{parse 句法分析}{4} -\indexentry{ambiguity 二义性}{5} -\indexentry{redundancy 冗余性}{5} -\indexentry{literalness 无修饰性}{5} -\indexentry{poetry 诗歌}{5} -\indexentry{prose 散文}{5} -\indexentry{Hello, World}{5} -\indexentry{Python 3.0}{5} -\indexentry{quotation mark 引号}{5} -\indexentry{print statement print 语句}{5} -\indexentry{statement!print 语句!打印}{5} -\indexentry{debugging 调试}{6} -\indexentry{error message 错误信息}{6} -\indexentry{debugging!emotional response 调试!情绪反应}{6} -\indexentry{emotional debugging 情绪调试}{6} -\indexentry{compile 编译}{6} -\indexentry{object code 目标代码}{7} -\indexentry{prompt 提示符}{7} -\indexentry{script 脚本}{7} -\indexentry{interactive mode 交互模式}{7} -\indexentry{script mode 脚本模式}{7} -\indexentry{program 程序}{7} -\indexentry{algorithm}{7} -\indexentry{bug}{7} -\indexentry{debugging 调试}{7} -\indexentry{syntax 语法}{7} -\indexentry{syntax error}{7} -\indexentry{exception 异常}{7} -\indexentry{semantics 语义}{7} -\indexentry{semantics error 语义错误}{7} -\indexentry{natural language 自然语言}{7} -\indexentry{formal language 正式语言}{7} -\indexentry{token 标记}{7} -\indexentry{parse 句法分析}{7} -\indexentry{print statement print 语句}{7} -\indexentry{statement!print 语句!打印}{7} -\indexentry{documentation 文档}{7} -\indexentry{python.org}{7} -\indexentry{help utility 帮助工具}{8} -\indexentry{caculator 计算器}{8} -\indexentry{running pace 跑步速度}{8} diff --git a/thinkpython/tex-zh/book.log b/thinkpython/tex-zh/book.log deleted file mode 100644 index 0d9f1aa..0000000 --- a/thinkpython/tex-zh/book.log +++ /dev/null @@ -1,988 +0,0 @@ -This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian) (format=xelatex 2010.10.11) 23 OCT 2010 13:59 -entering extended mode - restricted \write18 enabled. - %&-line parsing enabled. -**book.tex -(./book.tex -LaTeX2e <2009/09/24> -Babel and hyphenation patterns for english, usenglishmax, dumylang, noh -yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov -ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1 -9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san -skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn -orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian -, estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po -rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded. -(/usr/share/texmf-texlive/tex/latex/base/book.cls -Document Class: book 2007/10/19 v1.4h Standard LaTeX document class -(/usr/share/texmf-texlive/tex/latex/base/bk10.clo -File: bk10.clo 2007/10/19 v1.4h Standard LaTeX file (size option) -) -\c@part=\count80 -\c@chapter=\count81 -\c@section=\count82 -\c@subsection=\count83 -\c@subsubsection=\count84 -\c@paragraph=\count85 -\c@subparagraph=\count86 -\c@figure=\count87 -\c@table=\count88 -\abovecaptionskip=\skip41 -\belowcaptionskip=\skip42 -\bibindent=\dimen102 -) -(/usr/share/texmf-texlive/tex/latex/geometry/geometry.sty -Package: geometry 2008/12/21 v4.2 Page Geometry - -(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty -Package: keyval 1999/03/16 v1.13 key=value parser (DPC) -\KV@toks@=\toks14 -) -(/usr/share/texmf-texlive/tex/generic/oberdiek/ifpdf.sty -Package: ifpdf 2009/04/10 v2.0 Provides the ifpdf switch (HO) -Package ifpdf Info: pdfTeX in pdf mode not detected. -) -(/usr/share/texmf-texlive/tex/generic/oberdiek/ifvtex.sty -Package: ifvtex 2008/11/04 v1.4 Switches for detecting VTeX and its modes (HO) -Package ifvtex Info: VTeX not detected. -) -\Gm@cnth=\count89 -\Gm@cntv=\count90 -\c@Gm@tempcnt=\count91 -\Gm@bindingoffset=\dimen103 -\Gm@wd@mp=\dimen104 -\Gm@odd@mp=\dimen105 -\Gm@even@mp=\dimen106 -\Gm@dimlist=\toks15 - -(/usr/share/texmf-texlive/tex/xelatex/xetexconfig/geometry.cfg)) -(/usr/share/texmf-texlive/tex/latex/pslatex/pslatex.sty -Package: pslatex 1996/07/24 v1.2 pslatex emulation (DPC) -LaTeX Font Info: Redeclaring symbol font `operators' on input line 65. -LaTeX Font Info: Overwriting symbol font `operators' in version `normal' -(Font) OT1/cmr/m/n --> OT1/ptmcm/m/n on input line 65. -LaTeX Font Info: Overwriting symbol font `operators' in version `bold' -(Font) OT1/cmr/bx/n --> OT1/ptmcm/m/n on input line 65. -LaTeX Font Info: Redeclaring symbol font `letters' on input line 66. -LaTeX Font Info: Overwriting symbol font `letters' in version `normal' -(Font) OML/cmm/m/it --> OML/ptmcm/m/it on input line 66. -LaTeX Font Info: Overwriting symbol font `letters' in version `bold' -(Font) OML/cmm/b/it --> OML/ptmcm/m/it on input line 66. -LaTeX Font Info: Redeclaring symbol font `symbols' on input line 67. -LaTeX Font Info: Overwriting symbol font `symbols' in version `normal' -(Font) OMS/cmsy/m/n --> OMS/pzccm/m/n on input line 67. -LaTeX Font Info: Overwriting symbol font `symbols' in version `bold' -(Font) OMS/cmsy/b/n --> OMS/pzccm/m/n on input line 67. -LaTeX Font Info: Redeclaring symbol font `largesymbols' on input line 68. -LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal' -(Font) OMX/cmex/m/n --> OMX/psycm/m/n on input line 68. -LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold' -(Font) OMX/cmex/m/n --> OMX/psycm/m/n on input line 68. -\symbold=\mathgroup4 -\symitalic=\mathgroup5 -LaTeX Font Info: Redeclaring math alphabet \mathbf on input line 74. -LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' -(Font) OT1/cmr/bx/n --> OT1/ptm/bx/n on input line 74. -LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold' -(Font) OT1/cmr/bx/n --> OT1/ptm/bx/n on input line 74. -LaTeX Font Info: Redeclaring math alphabet \mathit on input line 75. -LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' -(Font) OT1/cmr/m/it --> OT1/ptm/m/it on input line 75. -LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' -(Font) OT1/cmr/bx/it --> OT1/ptm/m/it on input line 75. -) -(/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty -\Urlmuskip=\muskip10 -Package: url 2006/04/12 ver 3.3 Verb mode for urls, etc. -) -(/usr/share/texmf-texlive/tex/latex/fancyhdr/fancyhdr.sty -\fancy@headwidth=\skip43 -\f@ncyO@elh=\skip44 -\f@ncyO@erh=\skip45 -\f@ncyO@olh=\skip46 -\f@ncyO@orh=\skip47 -\f@ncyO@elf=\skip48 -\f@ncyO@erf=\skip49 -\f@ncyO@olf=\skip50 -\f@ncyO@orf=\skip51 -) -(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty -Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) - -(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty -Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR) - -(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty -Package: trig 1999/03/16 v1.09 sin cos tan (DPC) -) -(/etc/texmf/tex/latex/config/graphics.cfg -File: graphics.cfg 2009/08/28 v1.8 graphics configuration of TeX Live -) -Package graphics Info: Driver file: xetex.def on input line 91. - -(/usr/share/texmf-texlive/tex/xelatex/xetex-def/xetex.def -File: xetex.def 2009/11/22 v0.94 LaTeX color/graphics driver for XeTeX (RRM/JK) - -)) -\Gin@req@height=\dimen107 -\Gin@req@width=\dimen108 -) -(/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty -Package: amsmath 2000/07/18 v2.13 AMS math features -\@mathmargin=\skip52 - -For additional information on amsmath, use the `?' option. -(/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty -Package: amstext 2000/06/29 v2.01 - -(/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty -File: amsgen.sty 1999/11/30 v2.0 -\@emptytoks=\toks16 -\ex@=\dimen109 -)) -(/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty -Package: amsbsy 1999/11/29 v1.2d -\pmbraise@=\dimen110 -) -(/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty -Package: amsopn 1999/12/14 v2.01 operator names -) -\inf@bad=\count92 -LaTeX Info: Redefining \frac on input line 211. -\uproot@=\count93 -\leftroot@=\count94 -LaTeX Info: Redefining \overline on input line 307. -\classnum@=\count95 -\DOTSCASE@=\count96 -LaTeX Info: Redefining \ldots on input line 379. -LaTeX Info: Redefining \dots on input line 382. -LaTeX Info: Redefining \cdots on input line 467. -\Mathstrutbox@=\box26 -\strutbox@=\box27 -\big@size=\dimen111 -LaTeX Font Info: Redeclaring font encoding OML on input line 567. -LaTeX Font Info: Redeclaring font encoding OMS on input line 568. -\macc@depth=\count97 -\c@MaxMatrixCols=\count98 -\dotsspace@=\muskip11 -\c@parentequation=\count99 -\dspbrk@lvl=\count100 -\tag@help=\toks17 -\row@=\count101 -\column@=\count102 -\maxfields@=\count103 -\andhelp@=\toks18 -\eqnshift@=\dimen112 -\alignsep@=\dimen113 -\tagshift@=\dimen114 -\tagwidth@=\dimen115 -\totwidth@=\dimen116 -\lineht@=\dimen117 -\@envbody=\toks19 -\multlinegap=\skip53 -\multlinetaggap=\skip54 -\mathdisplay@stack=\toks20 -LaTeX Info: Redefining \[ on input line 2666. -LaTeX Info: Redefining \] on input line 2667. -) -(/usr/share/texmf-texlive/tex/latex/amscls/amsthm.sty -Package: amsthm 2004/08/06 v2.20 -\thm@style=\toks21 -\thm@bodyfont=\toks22 -\thm@headfont=\toks23 -\thm@notefont=\toks24 -\thm@headpunct=\toks25 -\thm@preskip=\skip55 -\thm@postskip=\skip56 -\thm@headsep=\skip57 -\dth@everypar=\toks26 -) -(/usr/share/texmf-texlive/tex/latex/amsfonts/amssymb.sty -Package: amssymb 2009/06/22 v3.00 - -(/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty -Package: amsfonts 2009/06/22 v3.00 Basic AMSFonts support -\symAMSa=\mathgroup6 -\symAMSb=\mathgroup7 -LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold' -(Font) U/euf/m/n --> U/euf/b/n on input line 96. -)) -(/usr/share/texmf-texlive/tex/latex/exercise/exercise.sty -Package: exercise 2009/03/26 v1.3 Exercise package (P.Pichaureau) - -(/usr/share/texmf-texlive/tex/latex/base/ifthen.sty -Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC) -) -\Exesep=\skip58 -\Exetopsep=\skip59 -\Exeparsep=\skip60 -\Exepartopsep=\skip61 -\Exeleftmargin=\skip62 -\Exerightmargin=\skip63 -\Exelabelwidth=\skip64 -\Exelabelsep=\skip65 -\ExerciseBefore=\skip66 -\QuestionBefore=\skip67 -\subQuestionBefore=\skip68 -\subsubQuestionBefore=\skip69 -\QuestionIndent=\skip70 -\subQuestionIndent=\skip71 -\subsubQuestionIndent=\skip72 -\c@Exercise=\count104 -\c@ExePart=\count105 -\c@Question=\count106 -\c@subQuestion=\count107 -\c@subsubQuestion=\count108 -\c@savedQuestion=\count109 -\c@savedsubQuestion=\count110 -\c@savedsubsubQuestion=\count111 -\@QuestionLevel=\count112 -\@Exercisebox=\box28 -\all@Exercisebox=\box29 -\temp@Exercisebox=\box30 -\all@Answerbox=\box31 -\temp@Answerbox=\box32 -\ExerciseDifficulty=\count113 -\QuestionDifficulty=\count114 -\subQuestionDifficulty=\count115 -\subsubQuestionDifficulty=\count116 -\ExePartDifficulty=\count117 -\@Answerbox=\box33 -\colonnesLevel=\count118 -\tempskipa=\skip73 -\tempskipb=\skip74 -\@savedmathindent=\skip75 -) -(/usr/share/texmf-texlive/tex/latex/base/makeidx.sty -Package: makeidx 2000/03/29 v1.0m Standard LaTeX package -) -(/usr/share/texmf-texlive/tex/latex/setspace/setspace.sty -Package: setspace 2000/12/01 6.7 Contributed and Supported LaTeX2e package - -Package: `setspace' 6.7 <2000/12/01> -) (/usr/share/texmf/tex/latex/misc/hevea.sty -Package: hevea 2002/01/11 - -(/usr/share/texmf-texlive/tex/latex/comment/comment.sty -\CommentStream=\write3 - -Excluding comment 'comment') -\c@cuttingdepth=\count119 - Excluding comment 'rawhtml' -Excluding comment 'htmlonly' -\@bgcolorbin=\box34 -) -(/usr/share/texmf-texlive/tex/latex/upquote/upquote.sty -Package: upquote 2003/08/11 v1.1 Covington's upright-quote modification to verb -atim and verb - -(/usr/share/texmf-texlive/tex/latex/base/textcomp.sty -Package: textcomp 2005/09/27 v1.99g Standard LaTeX package -Package textcomp Info: Sub-encoding information: -(textcomp) 5 = only ISO-Adobe without \textcurrency -(textcomp) 4 = 5 + \texteuro -(textcomp) 3 = 4 + \textohm -(textcomp) 2 = 3 + \textestimated + \textcurrency -(textcomp) 1 = TS1 - \textcircled - \t -(textcomp) 0 = TS1 (full) -(textcomp) Font families with sub-encoding setting implement -(textcomp) only a restricted character set as indicated. -(textcomp) Family '?' is the default used for unknown fonts. -(textcomp) See the documentation for details. -Package textcomp Info: Setting ? sub-encoding to TS1/1 on input line 71. - -(/usr/share/texmf-texlive/tex/latex/base/ts1enc.def -File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file -) -LaTeX Info: Redefining \oldstylenums on input line 266. -Package textcomp Info: Setting cmr sub-encoding to TS1/0 on input line 281. -Package textcomp Info: Setting cmss sub-encoding to TS1/0 on input line 282. -Package textcomp Info: Setting cmtt sub-encoding to TS1/0 on input line 283. -Package textcomp Info: Setting cmvtt sub-encoding to TS1/0 on input line 284. -Package textcomp Info: Setting cmbr sub-encoding to TS1/0 on input line 285. -Package textcomp Info: Setting cmtl sub-encoding to TS1/0 on input line 286. -Package textcomp Info: Setting ccr sub-encoding to TS1/0 on input line 287. -Package textcomp Info: Setting ptm sub-encoding to TS1/4 on input line 288. -Package textcomp Info: Setting pcr sub-encoding to TS1/4 on input line 289. -Package textcomp Info: Setting phv sub-encoding to TS1/4 on input line 290. -Package textcomp Info: Setting ppl sub-encoding to TS1/3 on input line 291. -Package textcomp Info: Setting pag sub-encoding to TS1/4 on input line 292. -Package textcomp Info: Setting pbk sub-encoding to TS1/4 on input line 293. -Package textcomp Info: Setting pnc sub-encoding to TS1/4 on input line 294. -Package textcomp Info: Setting pzc sub-encoding to TS1/4 on input line 295. -Package textcomp Info: Setting bch sub-encoding to TS1/4 on input line 296. -Package textcomp Info: Setting put sub-encoding to TS1/5 on input line 297. -Package textcomp Info: Setting uag sub-encoding to TS1/5 on input line 298. -Package textcomp Info: Setting ugq sub-encoding to TS1/5 on input line 299. -Package textcomp Info: Setting ul8 sub-encoding to TS1/4 on input line 300. -Package textcomp Info: Setting ul9 sub-encoding to TS1/4 on input line 301. -Package textcomp Info: Setting augie sub-encoding to TS1/5 on input line 302. -Package textcomp Info: Setting dayrom sub-encoding to TS1/3 on input line 303. -Package textcomp Info: Setting dayroms sub-encoding to TS1/3 on input line 304. - -Package textcomp Info: Setting pxr sub-encoding to TS1/0 on input line 305. -Package textcomp Info: Setting pxss sub-encoding to TS1/0 on input line 306. -Package textcomp Info: Setting pxtt sub-encoding to TS1/0 on input line 307. -Package textcomp Info: Setting txr sub-encoding to TS1/0 on input line 308. -Package textcomp Info: Setting txss sub-encoding to TS1/0 on input line 309. -Package textcomp Info: Setting txtt sub-encoding to TS1/0 on input line 310. -Package textcomp Info: Setting futs sub-encoding to TS1/4 on input line 311. -Package textcomp Info: Setting futx sub-encoding to TS1/4 on input line 312. -Package textcomp Info: Setting futj sub-encoding to TS1/4 on input line 313. -Package textcomp Info: Setting hlh sub-encoding to TS1/3 on input line 314. -Package textcomp Info: Setting hls sub-encoding to TS1/3 on input line 315. -Package textcomp Info: Setting hlst sub-encoding to TS1/3 on input line 316. -Package textcomp Info: Setting hlct sub-encoding to TS1/5 on input line 317. -Package textcomp Info: Setting hlx sub-encoding to TS1/5 on input line 318. -Package textcomp Info: Setting hlce sub-encoding to TS1/5 on input line 319. -Package textcomp Info: Setting hlcn sub-encoding to TS1/5 on input line 320. -Package textcomp Info: Setting hlcw sub-encoding to TS1/5 on input line 321. -Package textcomp Info: Setting hlcf sub-encoding to TS1/5 on input line 322. -Package textcomp Info: Setting pplx sub-encoding to TS1/3 on input line 323. -Package textcomp Info: Setting pplj sub-encoding to TS1/3 on input line 324. -Package textcomp Info: Setting ptmx sub-encoding to TS1/4 on input line 325. -Package textcomp Info: Setting ptmj sub-encoding to TS1/4 on input line 326. -)) -(/usr/share/texmf-texlive/tex/xelatex/xecjk/xeCJK.sty -Package: xeCJK 2009/09/30 2.3.10 - -(/usr/share/texmf-texlive/tex/generic/ifxetex/ifxetex.sty -Package: ifxetex 2009/01/23 v0.5 Provides ifxetex conditional -) -(/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.sty -Package: fontspec 2008/08/09 v1.18 Advanced font selection for XeLaTeX -\c@zf@newff=\count120 -\c@zf@index=\count121 -\c@zf@script=\count122 -\c@zf@language=\count123 - -(/usr/share/texmf-texlive/tex/latex/tools/calc.sty -Package: calc 2007/08/22 v4.3 Infix arithmetic (KKT,FJ) -\calc@Acount=\count124 -\calc@Bcount=\count125 -\calc@Adimen=\dimen118 -\calc@Bdimen=\dimen119 -\calc@Askip=\skip76 -\calc@Bskip=\skip77 -LaTeX Info: Redefining \setlength on input line 76. -LaTeX Info: Redefining \addtolength on input line 77. -\calc@Ccount=\count126 -\calc@Cskip=\skip78 -) -(/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty -Package: xkeyval 2008/08/13 v2.6a package option processing (HA) - -(/usr/share/texmf-texlive/tex/generic/xkeyval/xkeyval.tex -\XKV@toks=\toks27 -\XKV@tempa@toks=\toks28 -\XKV@depth=\count127 -File: xkeyval.tex 2008/08/13 v2.6a key=value parser (HA) -)) -(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty -Package: fontenc 2005/09/27 v1.99g Standard LaTeX package - -(/usr/share/texmf-texlive/tex/xelatex/euenc/eu1enc.def -File: eu1enc.def 2008/03/08 v0.1d Experimental unicode font encoding -) -LaTeX Font Info: Try loading font information for EU1+lmr on input line 100. - - -(/usr/share/texmf-texlive/tex/xelatex/euenc/eu1lmr.fd -File: eu1lmr.fd 2007/01/14 v1.3 Font defs for Latin Modern -)) -LaTeX Info: Redefining \itshape on input line 1163. -LaTeX Info: Redefining \slshape on input line 1166. -LaTeX Info: Redefining \scshape on input line 1169. -LaTeX Info: Redefining \upshape on input line 1172. - -fontspec.cfg loaded. -(/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.cfg)) -\xeCJK@cnta=\count128 -\xeCJK@cntb=\count129 -\xeCJK@cntc=\count130 -\xeCJK@cntd=\count131 -\xeCJK@cnte=\count132 -\xeCJK@dima=\dimen120 -LaTeX Info: Redefining \rmfamily on input line 762. -LaTeX Info: Redefining \sffamily on input line 766. -LaTeX Info: Redefining \ttfamily on input line 770. -\xeCJK@featureadded=\count133 -) -Unknown feature `style=Regular' in font `AR PL SungtiL GB'. -Unknown feature `style=Regular/ICU' in font `AR PL SungtiL GB'. -\c@zf@famc@AR PL SungtiL GB:style=Regular=\count134 -Package fontspec Info: Defining font family for 'AR PL SungtiL GB:style=Regular -'with options [] on input line 35. -Unknown feature `style=Regular/B/ICU' in font `AR PL SungtiL GB'. -Unknown feature `style=Regular/I/ICU' in font `AR PL SungtiL GB'. -Unknown feature `style=Regular/BI/ICU' in font `AR PL SungtiL GB'. -LaTeX Info: Redefining \xeCJK@font@rm on input line 35. -Unknown feature `style=Regular' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -\c@zf@famc@TeXGyrePagella:style=Regular=\count135 -Package fontspec Info: Defining font family for 'TeXGyrePagella:style=Regular'w -ith options [] on input line 36. -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/B/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/I/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/BI/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -\@indexfile=\write4 -\openout4 = `book.idx'. - - -Writing index file book.idx -(./book.aux) -\openout1 = `book.aux'. - -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 57. -LaTeX Font Info: ... okay on input line 57. -LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 57. -LaTeX Font Info: ... okay on input line 57. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 57. -LaTeX Font Info: ... okay on input line 57. -LaTeX Font Info: Checking defaults for OMS/pzccm/m/n on input line 57. -LaTeX Font Info: Try loading font information for OMS+pzccm on input line 57 -. - (/usr/share/texmf-texlive/tex/latex/psnfss/omspzccm.fd -File: omspzccm.fd 2000/01/03 Fontinst v1.801 font definitions for OMS/pzccm. -) -LaTeX Font Info: ... okay on input line 57. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 57. -LaTeX Font Info: ... okay on input line 57. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 57. -LaTeX Font Info: ... okay on input line 57. -LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 57. -LaTeX Font Info: Try loading font information for TS1+cmr on input line 57. - -(/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd -File: ts1cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions -) -LaTeX Font Info: ... okay on input line 57. -LaTeX Font Info: Checking defaults for EU1/lmr/m/n on input line 57. -LaTeX Font Info: ... okay on input line 57. - -*geometry detected driver: pdftex* --------------------- Geometry parameters -paper: class default -landscape: -- -twocolumn: -- -twoside: true -asymmetric: -- -h-parts: 130.086pt, 397.48499pt, 86.72401pt -v-parts: 90.3375pt, 614.295pt, 90.3375pt -hmarginratio: 3:2 -vmarginratio: 1:1 -lines: -- -heightrounded: -- -bindingoffset: 0.0pt -truedimen: -- -includehead: -- -includefoot: -- -includemp: -- -driver: pdftex --------------------- Page layout dimensions and switches -\paperwidth 614.295pt -\paperheight 794.96999pt -\textwidth 397.48499pt -\textheight 614.295pt -\oddsidemargin 57.81601pt -\evensidemargin 14.45403pt -\topmargin -11.99998pt -\headheight 12.0pt -\headsep 18.06749pt -\footskip 25.29494pt -\marginparwidth 125.0pt -\marginparsep 7.0pt -\columnsep 10.0pt -\skip\footins 9.0pt plus 4.0pt minus 2.0pt -\hoffset 0.0pt -\voffset 0.0pt -\mag 1000 -\@twosidetrue \@mparswitchtrue -(1in=72.27pt, 1cm=28.45pt) ------------------------ -Package fontspec Info: Adjusting the maths setup (use [no-math] to avoid this). - on input line 57. -\symlegacymaths=\mathgroup8 -LaTeX Font Info: Overwriting symbol font `legacymaths' in version `bold' -(Font) OT1/cmr/m/n --> OT1/cmr/bx/n on input line 57. -LaTeX Font Info: Redeclaring math accent \acute on input line 57. -LaTeX Font Info: Redeclaring math accent \grave on input line 57. -LaTeX Font Info: Redeclaring math accent \ddot on input line 57. -LaTeX Font Info: Redeclaring math accent \tilde on input line 57. -LaTeX Font Info: Redeclaring math accent \bar on input line 57. -LaTeX Font Info: Redeclaring math accent \breve on input line 57. -LaTeX Font Info: Redeclaring math accent \check on input line 57. -LaTeX Font Info: Redeclaring math accent \hat on input line 57. -LaTeX Font Info: Redeclaring math accent \dot on input line 57. -LaTeX Font Info: Redeclaring math accent \mathring on input line 57. -LaTeX Font Info: Redeclaring math symbol \Gamma on input line 57. -LaTeX Font Info: Redeclaring math symbol \Delta on input line 57. -LaTeX Font Info: Redeclaring math symbol \Theta on input line 57. -LaTeX Font Info: Redeclaring math symbol \Lambda on input line 57. -LaTeX Font Info: Redeclaring math symbol \Xi on input line 57. -LaTeX Font Info: Redeclaring math symbol \Pi on input line 57. -LaTeX Font Info: Redeclaring math symbol \Sigma on input line 57. -LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 57. -LaTeX Font Info: Redeclaring math symbol \Phi on input line 57. -LaTeX Font Info: Redeclaring math symbol \Psi on input line 57. -LaTeX Font Info: Redeclaring math symbol \Omega on input line 57. -LaTeX Font Info: Redeclaring math symbol \mathdollar on input line 57. -LaTeX Font Info: Redeclaring symbol font `operators' on input line 57. -LaTeX Font Info: Encoding `OT1' has changed to `EU1' for symbol font -(Font) `operators' in the math version `normal' on input line 57. -LaTeX Font Info: Overwriting symbol font `operators' in version `normal' -(Font) OT1/ptmcm/m/n --> EU1/TeXGyrePagella:style=Regular(0)/m -/n on input line 57. -LaTeX Font Info: Encoding `OT1' has changed to `EU1' for symbol font -(Font) `operators' in the math version `bold' on input line 57. -LaTeX Font Info: Overwriting symbol font `operators' in version `bold' -(Font) OT1/ptmcm/m/n --> EU1/TeXGyrePagella:style=Regular(0)/m -/n on input line 57. -LaTeX Font Info: Overwriting symbol font `operators' in version `normal' -(Font) EU1/TeXGyrePagella:style=Regular(0)/m/n --> EU1/TeXGyre -Pagella:style=Regular(0)/m/n on input line 57. -LaTeX Font Info: Overwriting math alphabet `\mathrm' in version `normal' -(Font) EU1/TeXGyrePagella:style=Regular(0)/m/n --> EU1/TeXGyre -Pagella:style=Regular(0)/m/n on input line 57. -LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' -(Font) OT1/ptm/m/it --> EU1/TeXGyrePagella:style=Regular(0)/m/ -it on input line 57. -LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' -(Font) OT1/ptm/bx/n --> EU1/TeXGyrePagella:style=Regular(0)/bx -/n on input line 57. -LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal' -(Font) OT1/cmss/m/n --> EU1/lmss/m/n on input line 57. -LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal' -(Font) OT1/cmtt/m/n --> EU1/lmtt/m/n on input line 57. -LaTeX Font Info: Overwriting symbol font `operators' in version `bold' -(Font) EU1/TeXGyrePagella:style=Regular(0)/m/n --> EU1/TeXGyre -Pagella:style=Regular(0)/bx/n on input line 57. -LaTeX Font Info: Overwriting math alphabet `\mathrm' in version `bold' -(Font) EU1/TeXGyrePagella:style=Regular(0)/m/n --> EU1/TeXGyre -Pagella:style=Regular(0)/bx/n on input line 57. -LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' -(Font) OT1/ptm/m/it --> EU1/TeXGyrePagella:style=Regular(0)/bx -/it on input line 57. -LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold' -(Font) OT1/cmss/bx/n --> EU1/lmss/bx/n on input line 57. -LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold' -(Font) OT1/cmtt/m/n --> EU1/lmtt/bx/n on input line 57. -(./latexonly) -\c@ex=\count136 -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/ICU' in font `AR PL SungtiL GB'. -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/ICU' in font `AR PL SungtiL GB'. - [1 - - -] [2] -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. - [3] -LaTeX Font Info: Try loading font information for TS1+TeXGyrePagella:style=R -egular(0) on input line 129. -LaTeX Font Info: No file TS1TeXGyrePagella:style=Regular(0).fd. on input lin -e 129. -LaTeX Font Info: Font shape `TS1/TeXGyrePagella:style=Regular(0)/m/n' undefi -ned -(Font) using `TS1/cmr/m/n' instead -(Font) for symbol `textcopyright' on input line 129. -Unknown feature `style=Regular/B/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/B/ICU' in font `AR PL SungtiL GB'. -Unknown feature `style=Regular/ICU' in font `AR PL SungtiL GB'. -Unknown feature `style=Regular/I/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/I/ICU' in font `AR PL SungtiL GB'. - - -Package xeCJK Warning: Unknown CJK family `tt' is ignored. -Use \setCJKfamilyfont to define a CJK family. on input line 154. - -LaTeX Font Info: Try loading font information for EU1+lmtt on input line 154 -. -(/usr/share/texmf-texlive/tex/xelatex/euenc/eu1lmtt.fd -File: eu1lmtt.fd 2007/01/14 v1.3 Font defs for Latin Modern -) -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -LaTeX Font Info: Try loading font information for OML+ptmcm on input line 15 -8. - -(/usr/share/texmf-texlive/tex/latex/psnfss/omlptmcm.fd -File: omlptmcm.fd 2000/01/03 Fontinst v1.801 font definitions for OML/ptmcm. -) -LaTeX Font Info: Try loading font information for OMX+psycm on input line 15 -8. - -(/usr/share/texmf-texlive/tex/latex/psnfss/omxpsycm.fd -File: omxpsycm.fd 2000/01/03 Fontinst v1.801 font definitions for OMX/psycm. -) -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <9> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 158. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <7> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 158. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <5> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 158. -LaTeX Font Info: Try loading font information for U+msa on input line 158. - -(/usr/share/texmf-texlive/tex/latex/amsfonts/umsa.fd -File: umsa.fd 2009/06/22 v3.00 AMS symbols A -) -LaTeX Font Info: Try loading font information for U+msb on input line 158. - -(/usr/share/texmf-texlive/tex/latex/amsfonts/umsb.fd -File: umsb.fd 2009/06/22 v3.00 AMS symbols B -) [4] -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/B/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/B/ICU' in font `AR PL SungtiL GB'. -Unknown feature `style=Regular/B/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/B/ICU' in font `AR PL SungtiL GB'. -Unknown feature `style=Regular/ICU' in font `AR PL SungtiL GB'. - -Underfull \hbox (badness 10000) in paragraph at lines 189--192 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 193--195 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 209--210 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 211--212 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 213--214 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 218--219 - - [] - -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <10> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 220. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <7.4> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 220. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <6> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 220. - -Underfull \hbox (badness 10000) in paragraph at lines 220--221 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 222--223 - - [] - -[5 - -] -Underfull \hbox (badness 10000) in paragraph at lines 224--225 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 242--243 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 244--246 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 253--254 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 255--256 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 257--258 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 262--263 - - [] - -Unknown feature `style=Regular/B/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/B/ICU' in font `AR PL SungtiL GB'. - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.12543pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[6] - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.14496pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[7] - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.12543pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[8] -LaTeX Font Info: Try loading font information for OT1+TeXGyrePagella:style=R -egular(0) on input line 482. -LaTeX Font Info: No file OT1TeXGyrePagella:style=Regular(0).fd. on input lin -e 482. -LaTeX Font Info: Font shape `OT1/TeXGyrePagella:style=Regular(0)/m/n' undefi -ned -(Font) using `OT1/cmr/m/n' instead on input line 482. - - -LaTeX Warning: Reference `exrotatepairs' on page ix undefined on input line 505 -. - - -LaTeX Warning: Reference `checksum' on page ix undefined on input line 519. - - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.14496pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[9] - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.12543pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[10] (./book.toc) -\tf@toc=\write5 -\openout5 = `book.toc'. - - [11 - - -] [12 - -] -Chapter 1. -Unknown feature `style=Regular/B/ICU' in font `TeXGyrePagella Regular'. - -Underfull \hbox (badness 10000) in paragraph at lines 604--605 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 612--614 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 615--618 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 625--629 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 636--637 - - [] - -File: figs/interpret.eps Graphic file (type eps) - [1 - - -] -File: figs/compile.eps Graphic file (type eps) - -Underfull \hbox (badness 10000) in paragraph at lines 666--668 - - [] - - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.12543pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[2] -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/B/ICU' in font `TeXGyrePagella Regular'. -Unknown feature `style=Regular/B/ICU' in font `AR PL SungtiL GB'. - -Underfull \hbox (badness 10000) in paragraph at lines 739--740 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 753--754 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 758--759 - - [] - -Unknown feature `style=Regular/I/ICU' in font `TeXGyrePagella Regular'. - -Underfull \hbox (badness 10000) in paragraph at lines 760--761 - - [] - - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.09613pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[3] -Underfull \hbox (badness 10000) in paragraph at lines 765--766 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 779--780 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 787--788 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 804--805 - - [] - - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.12543pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[4] -Unknown feature `style=Regular/ICU' in font `TeXGyrePagella Regular'. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <8> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 818. -Unknown feature `style=Regular/ICU' in font `AR PL SungtiL GB'. -LaTeX Font Info: Try loading font information for TS1+lmtt on input line 849 -. - (/usr/share/texmf/tex/latex/lm/ts1lmtt.fd -File: ts1lmtt.fd 2009/10/30 v1.6 Font defs for Latin Modern -) -Underfull \hbox (badness 10000) in paragraph at lines 874--877 - - [] - - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.18402pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[5] -Underfull \hbox (badness 10000) in paragraph at lines 878--879 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 882--883 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 884--885 - - [] - -Unknown feature `style=Regular/I/ICU' in font `TeXGyrePagella Regular'. - -Underfull \hbox (badness 10000) in paragraph at lines 886--887 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 891--892 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 893--894 - - [] - - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.12543pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[6] -Underfull \hbox (badness 10000) in paragraph at lines 983--984 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 992--993 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 1001--1002 - - [] - -[7] - -Package Fancyhdr Warning: \headheight is too small (12.0pt): - Make it at least 12.12543pt. - We now make it that large for the rest of the document. - This may cause the page layout to be inconsistent, however. - -[8] (./book.aux) -LaTeX Font Info: Some font shapes were not available, defaults substituted. - - -LaTeX Warning: There were undefined references. - - ) -Here is how much of TeX's memory you used: - 5900 strings out of 494665 - 98313 string characters out of 1166476 - 183155 words of memory out of 3000000 - 8957 multiletter control sequences out of 15000+50000 - 24367 words of font info for 115 fonts, out of 3000000 for 9000 - 669 hyphenation exceptions out of 8191 - 34i,10n,43p,458b,283s stack positions out of 5000i,500n,10000p,200000b,50000s - -Output written on book.pdf (20 pages). diff --git a/thinkpython/tex-zh/book.pdf b/thinkpython/tex-zh/book.pdf deleted file mode 100644 index ffffbd6..0000000 Binary files a/thinkpython/tex-zh/book.pdf and /dev/null differ diff --git a/thinkpython/tex-zh/book.tex b/thinkpython/tex-zh/book.tex index 4623525..0ce1a41 100644 --- a/thinkpython/tex-zh/book.tex +++ b/thinkpython/tex-zh/book.tex @@ -15,8 +15,7 @@ % \documentclass[10pt]{book} -\usepackage[width=5.5in,height=8.5in, - hmarginratio=3:2,vmarginratio=1:1]{geometry} %指定了{h,v}marginratio,width和height被忽略了,可以不用指定(参考geometry.pdf, $texdoc geometry.pdf)。 +\usepackage[width=5.5in,height=8.5in,hmarginratio=3:2,vmarginratio=1:1]{geometry} %指定了{h,v}marginratio,width和height被忽略了,可以不用指定(参考geometry.pdf, $texdoc geometry.pdf)。 %下面的这些包,你可能需要安装texlive-latex-extra(in Debian/Ubuntu) \usepackage{pslatex} % @@ -32,8 +31,8 @@ %这些是对中文的支持 \usepackage{xeCJK} \usepackage{fontspec} -\setCJKmainfont{AR PL SungtiL GB:style=Regular} -\setmainfont{TeXGyrePagella:style=Regular} +\setCJKmainfont{FangSong_GB2312:style=Regular} +\setmainfont{FangSong_GB2312:style=Regular} \XeTeXlinebreaklocale "zh" \XeTeXlinebreakskip=0pt plus 1pt minus 0.1pt @@ -55,979 +54,53 @@ \makeindex \begin{document} -\frontmatter -%LaTeXOnly - -\input{latexonly} - -\newtheorem{ex}{Exercise}[chapter] -\begin{latexonly} - -\renewcommand{\blankpage}{\thispagestyle{empty} \quad \newpage} - -%blankpage -%blankpage - -%-half title---------------------------------------------- -\thispagestyle{empty} -\begin{flushright} -\vspace*{2.0in} - -\begin{spacing}{3} -{\huge 思考Python}\\ -{\Large 像计算机科学家一样思考} -\end{spacing} - -\vspace{0.25in} - -Version \theversion - -\vfill -\end{flushright} - -%--------------------------- -\blankpage -\blankpage - -%---title page--------- -\pagebreak -\thispagestyle{empty} - -\begin{flushright} -\vspace*{2.0in} - -\begin{spacing}{3} -{\huge 思考Python}\\ -{\Large 像计算机科学家一样思考} -\end{spacing} - -\vspace{0.25in} -Version \theversion - -{\Large - Allen Downey\\ -} -{\Large - Walter Lewis\\ -} - - - -\vspace{0.5in} - -{\Large Green Tea Press}\\ -{\small Needham, Massachusetts} - -\vfill -\end{flushright} - -%---copyright------------------ -\pagebreak -\thispagestyle{empty} - -{\small - Copyright \copyright ~2008 Allen Downey. - -Printing history: - -\begin{description} - -\item[2002四月:] 第一版 {\em 像计算机科学家一样思考}. -\item[2007八月:] 大幅改动,把标题改为{\em 像(Python)程序员一样思考}. -\item[2008六月:] 大幅改动,把标题改为{\em 思考Python:像计算机科学家一样思考}. -\end{description} - -\vspace{0.2in} - -\begin{flushleft} %左对齐,类似的有flushright,centre -Green Tea Press \\ -9 Washburn Ave\\ -Needham MA 02492 -\end{flushleft} - - -Permission is granted to copy, distribute, and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 or -any later version published by the Free Software Foundation; with no -Invariant Sections, no Front-Cover Texts, and with no Back-Cover Texts. - -The GNU Free Documentation License is available from {\tt www.gnu.org} -or by writing to the Free Software Foundation, Inc., 59 Temple Place, -Suite 330, Boston, MA 02111-1307, USA. - -The original form of this book is \LaTeX\ source code. Compiling this -\LaTeX\ source has the effect of generating a device-independent -representation of a textbook, which can be converted to other formats -and printed. - -The \LaTeX\ source for this book is available from -\url{http://www.thinkpython.com} -\vspace{0.2in} -} - -\end{latexonly} - - -%htmlonly -\begin{htmlonly} - -%Title page for html version - -{\Large \thetitle} -\{\Large Allen B.Downet} -\{\Large 翻译:Walter Lewis} - -Version \theversion - -\setcounter{chapter}{-1} -\end{htmlonly} - -\chapter{前言} - -\section{本书的奇怪历史} - -1999年一月份的时候,我准备用Java教一门介绍性的编程课。在那之前,我已经 -教了三次,而且每次我都很失望。这门课的挂课率非常之高,尽管对那些通过的学 -生来说,整体的水平也是很低的。\\ - -我认为问题的根源之一是教科书。教科书太厚了,掺杂着大量不必要的Java细节 -内容,并且没有足够高水平的引导去指导学生如何编程。学生们深陷“陷阱门“:他们起步很轻松,逐步的学习,突然,大约在第五章的某个位置,困难出现了。学生必须快速的学习大量的新内容。结果,我不得不把剩下的学期花在挑选一些片段来教学。\\ - -课程开始的前两周,我决定自力更生--自己编写书。我的目标是: -\begin{itemize} - -\item 尽量简短.对学生来说,阅读十页比阅读无十页要好。 - -\item 注意词汇量。我尽量减少使用术语,而且在使用前必须先定义。 - -\item 逐步学习。为了避免陷阱门,我把最难的部分分解成一系列的小步骤。 - -\item 把重心放在编程,而不是编程语言。我采用最少的有用的Java语言的语法, -忽略其他的。 -\end{itemize} - -我需要一个书名,所以我就临时地把它叫做《像计算机科学家一样思考》\\ - -第一版很粗糙,但是很成功。学生们很乐意看它,并且能很好理解我在课堂上讲的难点,趣点和让他们实践的内容(这个最重要).\\ - -我用GNU自由文档许可证发布了这本书,读者们可以自由的复制,修改,发布这本书。 \\ - -\index{GNU Free Documentation License} -\index{Free Documentation License,GNU} - - 接下来发生的事儿极其的有趣。Jeff Elkner,居住在弗尼亚的高中老师,改变了我的书,把它翻译成了Python。他给我寄了份他翻译的副本,于是乎我就有了一段不寻常的学习Python的经历--通过阅读我自己的书。\\ - - Jeff和我随后修订了这本书,加入了Chris Meyers提供的一个案例学习。在2001年,我们共同发布了《像计算机科学家一样思考:Python编程》,当然同样是用GNU自由文档许可证。通过Gree Tea Press,我出版了这本书,并且开始在亚马逊和大学书店卖纸质书。Gree Tea Press出版的书可以从这儿获得\url{greenteapress.com}\\ - - 2003年,我开始在Olin College教书。第一次,我开始教Python。和教授Java的情况相反,学生们不再陷入泥潭,学到了更多,参与了很多有趣的项目,越学越带劲。\\ - - 在过去的五年里,我一直继续完善这本书,改正错误,提过某些例子的质量,加入一些其他的材料,特别是练习。在2008年,我开始重写这本书---同时,剑桥大学出版社的编辑联系到了我,他想出版本书的下一板。美妙的时刻!\\ - - 结构就出现了现在的这本书,不过有了一个简洁的名字《思考Python》。变化有: - \begin{itemize} - - \item 在每一章末尾加了点调试的部分。这些部分提供了发现和避免bug的通用技巧,也对Python的陷阱提出了警告。 - - \item 删除了最后几章关于列表和树实现的内容。虽然,我万分不舍,但是考虑到和本书余下的部分不协调,只能忍痛割爱。 - - \item 增加了一些案例学习---提供了练习,答案和相关讨论的大例子。一些东西是基于Swampy,这是我为了教学而设计的Python程序。 - Swampy,代码实例和部分答案可以从这儿获得\url{thinkpython.com}. - - \item 扩展了关于程序构建计划和基本的设计模式的讨论。 - - \item Python运用的更加地道。虽然这本书仍然是讨论编程的,而不是Python本身,但是现在我不得不承认这本书深受Python浸染。 - - \end{itemize} - - 我希望读者们可以享受这本书,也希望帮助你学习程序设计和像计算机科学家一样思考,哪怕是一丁丁点儿。\\ - -Allen B. Downey\\ -Needham MA\\ - -Allen Downey 是Olin College 大学计算机科学与技术系的副教授。 - - - -\section*{声明} - -首先,也是最重要的,我要感谢Jeff Elkner,是他把我的Java书翻译成了Python,也由此开启了这项“工程“,也把我领进了我最爱的编程语言大门。\\ - -我也要感谢Chris Meyers,他贡献了《像计算机科学家一样思考》的部分内容。\\ - -感谢FSF制定的GNU自由文档许可证,使我和Jeff 和Chris 的合作成为可能。\\ - -\index{GNU Free Documentation License} -\index{Free Documentation License,GNU} - -我也要感谢所以使用以前版本的学生和所有的贡献者,他们提供了宝贵的更正和建议。\\ - -感谢我的妻子,Lisa为她在这本书上所花费的努力,还有Gree Tea Press,和其他的一切。 - -\section*{贡献者名单} - -\index{贡献者} - -More than 100 sharp-eyed and thoughtful readers have sent in -suggestions and corrections over the past few years. Their -contributions, and enthusiasm for this project, have been a -huge help. - -If you have a suggestion or correction, please send email to -{\tt feedback@thinkpython.com}. If I make a change based on your -feedback, I will add you to the contributor list -(unless you ask to be omitted). - -If you include at least part of the sentence the -error appears in, that makes it easy for me to search. Page and -section numbers are fine, too, but not quite as easy to work with. -Thanks! - -\small - -\begin{itemize} - -\item Lloyd Hugh Allen sent in a correction to Section 8.4. - -\item Yvon Boulianne sent in a correction of a semantic error in -Chapter 5. - -\item Fred Bremmer submitted a correction in Section 2.1. - -\item Jonah Cohen wrote the Perl scripts to convert the -LaTeX source for this book into beautiful HTML. - -\item Michael Conlon sent in a grammar correction in Chapter 2 -and an improvement in style in Chapter 1, and he initiated discussion -on the technical aspects of interpreters. - -\item Benoit Girard sent in a -correction to a humorous mistake in Section 5.6. - -\item Courtney Gleason and Katherine Smith wrote {\tt horsebet.py}, -which was used as a case study in an earlier version of the book. Their -program can now be found on the website. - -\item Lee Harr submitted more corrections than we have room to list -here, and indeed he should be listed as one of the principal editors -of the text. - -\item James Kaylin is a student using the text. He has submitted -numerous corrections. - -\item David Kershaw fixed the broken {\tt catTwice} function in Section -3.10. - -\item Eddie Lam has sent in numerous corrections to Chapters -1, 2, and 3. -He also fixed the Makefile so that it creates an index the first time it is -run and helped us set up a versioning scheme. - -\item Man-Yong Lee sent in a correction to the example code in -Section 2.4. - -\item David Mayo pointed out that the word ``unconsciously" -in Chapter 1 needed -to be changed to ``subconsciously". - -\item Chris McAloon sent in several corrections to Sections 3.9 and -3.10. - -\item Matthew J. Moelter has been a long-time contributor who sent -in numerous corrections and suggestions to the book. - -\item Simon Dicon Montford reported a missing function definition and -several typos in Chapter 3. He also found errors in the {\tt increment} -function in Chapter 13. - -\item John Ouzts corrected the definition of ``return value" -in Chapter 3. - -\item Kevin Parks sent in valuable comments and suggestions as to how -to improve the distribution of the book. - -\item David Pool sent in a typo in the glossary of Chapter 1, as well -as kind words of encouragement. - -\item Michael Schmitt sent in a correction to the chapter on files -and exceptions. - -\item Robin Shaw pointed out an error in Section 13.1, where the -printTime function was used in an example without being defined. - -\item Paul Sleigh found an error in Chapter 7 and a bug in Jonah Cohen's -Perl script that generates HTML from LaTeX. - -\item Craig T. Snydal is testing the text in a course at Drew -University. He has contributed several valuable suggestions and corrections. - -\item Ian Thomas and his students are using the text in a programming -course. They are the first ones to test the chapters in the latter half -of the book, and they have made numerous corrections and suggestions. - -\item Keith Verheyden sent in a correction in Chapter 3. - -\item Peter Winstanley let us know about a longstanding error in -our Latin in Chapter 3. - -\item Chris Wrobel made corrections to the code in the chapter on -file I/O and exceptions. - -\item Moshe Zadka has made invaluable contributions to this project. -In addition to writing the first draft of the chapter on Dictionaries, he -provided continual guidance in the early stages of the book. - -\item Christoph Zwerschke sent several corrections and -pedagogic suggestions, and explained the difference between {\em gleich} -and {\em selbe}. - -\item James Mayer sent us a whole slew of spelling and -typographical errors, including two in the contributor list. - -\item Hayden McAfee caught a potentially confusing inconsistency -between two examples. - -\item Angel Arnal is part of an international team of translators -working on the Spanish version of the text. He has also found several -errors in the English version. - -\item Tauhidul Hoque and Lex Berezhny created the illustrations -in Chapter 1 and improved many of the other illustrations. - -\item Dr. Michele Alzetta caught an error in Chapter 8 and sent -some interesting pedagogic comments and suggestions about Fibonacci -and Old Maid. - -\item Andy Mitchell caught a typo in Chapter 1 and a broken example -in Chapter 2. - -\item Kalin Harvey suggested a clarification in Chapter 7 and -caught some typos. - -\item Christopher P. Smith caught several typos and helped us -update the book for Python 2.2. - -\item David Hutchins caught a typo in the Foreword. - -\item Gregor Lingl is teaching Python at a high school in Vienna, -Austria. He is working on a German translation of the book, -and he caught a couple of bad errors in Chapter 5. - -\item Julie Peters caught a typo in the Preface. - -\item Florin Oprina sent in an improvement in {\tt makeTime}, -a correction in {\tt printTime}, and a nice typo. - -\item D.~J.~Webre suggested a clarification in Chapter 3. - -\item Ken found a fistful of errors in Chapters 8, 9 and 11. - -\item Ivo Wever caught a typo in Chapter 5 and suggested a clarification -in Chapter 3. - -\item Curtis Yanko suggested a clarification in Chapter 2. - -\item Ben Logan sent in a number of typos and problems with translating -the book into HTML. - -\item Jason Armstrong saw the missing word in Chapter 2. - -\item Louis Cordier noticed a spot in Chapter 16 where the code -didn't match the text. - -\item Brian Cain suggested several clarifications in Chapters 2 and 3. - -\item Rob Black sent in a passel of corrections, including some -changes for Python 2.2. - -\item Jean-Philippe Rey at Ecole Centrale -Paris sent a number of patches, including some updates for Python 2.2 -and other thoughtful improvements. - -\item Jason Mader at George Washington University made a number -of useful suggestions and corrections. - -\item Jan Gundtofte-Bruun reminded us that ``a error'' is an error. - -\item Abel David and Alexis Dinno reminded us that the plural of -``matrix'' is ``matrices'', not ``matrixes''. This error was in the -book for years, but two readers with the same initials reported it on -the same day. Weird. - -\item Charles Thayer encouraged us to get rid of the semi-colons -we had put at the ends of some statements and to clean up our -use of ``argument'' and ``parameter''. - -\item Roger Sperberg pointed out a twisted piece of logic in Chapter 3. - -\item Sam Bull pointed out a confusing paragraph in Chapter 2. - -\item Andrew Cheung pointed out two instances of ``use before def.'' - -\item C. Corey Capel spotted the missing word in the Third Theorem -of Debugging and a typo in Chapter 4. - -\item Alessandra helped clear up some Turtle confusion. - -\item Wim Champagne found a brain-o in a dictionary example. - -\item Douglas Wright pointed out a problem with floor division in -{\tt arc}. - -\item Jared Spindor found some jetsam at the end of a sentence. - -\item Lin Peiheng sent a number of very helpful suggestions. - -\item Ray Hagtvedt sent in two errors and a not-quite-error. - -\item Torsten H\"{u}bsch pointed out an inconsistency in Swampy. - -\item Inga Petuhhov corrected an example in Chapter 14. - -\item Arne Babenhauserheide sent several helpful corrections. - -\item Mark E. Casida is is good at spotting repeated words. - -\item Scott Tyler filled in a that was missing. And then sent in -a heap of corrections. - -\item Gordon Shephard sent in several corrections, all in separate -emails. - -\item Andrew Turner {\tt spot}ted an error in Chapter 8. - -\item Adam Hobart fixed a problem with floor division in {\tt arc}. - -\item Daryl Hammond and Sarah Zimmerman pointed out that I served -up {\tt math.pi} too early. And Zim spotted a typo. - -\item George Sass found a bug in a Debugging section. - -\item Brian Bingham suggested Exercise~\ref{exrotatepairs}. - -\item Leah Engelbert-Fenton pointed out that I used {\tt tuple} -as a variable name, contrary to my own advice. And then found -a bunch of typos and a ``use before def.'' - -\item Joe Funke spotted a typo. - -\item Chao-chao Chen found an inconsistency in the Fibonacci example. - -\item Jeff Paine knows the difference between space and spam. - -\item Lubos Pintes sent in a typo. - -\item Gregg Lind and Abigail Heithoff suggested Exercise~\ref{checksum}. - -\item Max Hailperin has sent in a number of corrections and - suggestions. Max is one of the authors of the extraordinary {\em - Concrete Abstractions}, which you might want to read when you are - done with this book. - -\item Chotipat Pornavalai found an error in an error message. - -\item Stanislaw Antol sent a list of very helpful suggestions. - -\item Eric Pashman sent a number of corrections for Chapters 4--11. - -\item Miguel Azevedo found some typos. - -\item Jianhua Liu sent in a long list of corrections. - -\item Nick King found a missing word. - -\item Martin Zuther sent a long list of suggestions. - -\item Adam Zimmerman found an inconsistency in my instance -of an ``instance'' and several other errors. - -\item Ratnakar Tiwari suggested a footnote explaining degenerate -triangles. - -\item Anurag Goel suggested another solution for \verb"is_abecedarian" -and sent some additional corrections. And he knows how to -spell Jane Austen. - -\item Kelli Kratzer spotted one of the typos. - -\item Mark Griffiths pointed out a confusing example in Chapter 3. -\item Roydan Ongie found an error in my Newton's method. - -\item Patryk Wolowiec helped me with a problem in the HTML version. - -\item Mark Chonofsky told me about a new keyword in Python 3.0. - -\item Russell Coleman helped me with my geometry. - -\item Wei Huang spotted several typographical errors. - -\item Karen Barber spotted the the oldest typo in the book. - -\item Nam Nguyen found a typo and pointed out that I used the Decorator -pattern but didn't mention it by name. - -\item St\'{e}phane Morin sent in several corrections and suggestions. - -\item Paul Stoop corrected a typo in \verb+uses_only+. - -\item Eric Bronner pointed out a confusion in the discussion of the -order of operations. - -\item Alexandros Gezerlis set a new standard for the number and -quality of suggestions he submitted. We are deeply grateful! - -% ENDCONTRIB - -\end{itemize} - - -\normalsize -\clearemptydoublepage - -\begin{latexonly} - -\tableofcontents - -\clearemptydoublepage +\frontmatter -\end{latexonly} +\input{part/chapter00} \mainmatter -\chapter{编程的方式} - -这本书的的目的是教会大家如何像计算机科学家一样思考。计算机科学用严谨的语言来表明思想,尤其是计算。像工程师,他们设计,把各个组件装配成系统并且在可选方案中评估出折中方案。像科学家,他们研究复杂系统的性能,做出假定并且测试假设。 - - -\index{解决问题} - -对一个计算机科学家来说最重要的是解决问题。解决问题意味着清晰明确的阐述问题,积极思考问题答案,并且清楚正确的表达答案的能力。实践证明:学习如何编程是一种很好的机会来练习解决问题的技巧。这也是为什么把这章叫做“编程的方式“。\\ - -一方面,你将学习编程,一个非常有用的技巧。另一方面你将会把编程作为一种科技。随着我们的深入学习,这点会渐渐明晰。 - -\section{Python编程语言} -\index{编程语言} -\index{语言!编程} - -我们将要学习的编程语言是Python。Python仅是高级语言中的一种,你可能 -也听说过其他的高级编程语言,比如C,C++,Perl,和Java。\\ - -也有一些低级语言,有时也被称为机器语言或者汇编语言。一般来说,计算机 -只能执行用低级语言编写的程序。所以,用高级语言编写的程序在执行前必须 -做相应的处理。这会花费一定的时间,同时这也是高级语言的“缺点“。\\ - -\index{移植性} -\index{高级语言} -\index{低级语言} -\index{语言!高级} -\index{语言!低级} - -然而,高级语言的优点也是无限的。首先,用高级语言编程是一件非常容易的。 -用高级语言编程通常花费的时间比较少,同时编写的程序简短,易读,易纠错 -。第二,高级语言是可移植的,这意味着他们可以不加修改(或者修改很少)地运行在不同的平台上。低级语言编写的程序只能在一个机器上运行,如果想 -要运行在另外一台机器上,必须得重写。\\ - -基于这些优点,几乎所有的程序都是用高级语言编写的。低级语言统称仅仅用 -在一些专门的应用程序中。 - -\index{complie} -\index{interpret} - -有两种程序把高级语言“处理”成低级语言:解释器和编译器。解释器读取源程序,解释执行,也就是按照程序表达的意思"做事"。解释器一次解释一点,或者说,一次读取一行,然后执行。\\ - -\beforefig -\centerline{\includegraphics[height=0.77in]{figs/interpret.eps}} -\afterfig - -\index{源码} -\index{目标} -\index{可执行代码} - -编译器读取程序,完全转换之。在这种情况下,高级语言程序叫做源码,编译后的程序叫做目标代码或者叫可执行代码。一旦程序被编译,就可以直接执行,无须再编译。 - -\beforefig -\centerline{\includegraphics[height=0.77in]{figs/compile.eps}} -\afterfig - -一般地,我们把python当作是解释型语言,因为用Python编写的程序是通过 -解释器执行的。有两种使用解释器的方式:交互模式和脚本模式。在交互模式 -下,你可以输入Python程序,然后解释器输出结果: - -\index{交互模式} -\index{脚本模式} - -\beforeverb -\begin{verbatim} ->>>1 + 1 -2 -\end{verbatim} %直接输出以上两句,包括空白和断行 -\afterverb - -锯齿符,{\tt >>>},是提示符,解释器用它来表明自己已经准备好了, -如果你输入{\tt 1 + 1},解释器显示{\tt 2}。\\ - -\index{提示符} - -另外地,我们可以把代码存储在一个文件里,使用解释器执行文件,此时这个 -文件被称作脚本。习惯上,Python脚本的扩展名为{\tt .py}。 - -\index{脚本} - -如果要执行Python脚本,我们必须提供给解释器脚本的文件名。在UNIX命令窗口,可以输入{\tt python dinsdale.py}。在其他开发环境中,会有些细节方面的差别。可以在Python官网上(\url{python.org})找到相应的指导。 - -\index{测试!交互模式} - -在交互模式下工作很容易测试一小段代码,因为可以随时输入,并且立刻执行。但如果代码量较大,我们必须把代码存放在脚本里,这样方便我们以后修改执行。 - -\section{什么是程序} - -程序就是指令集合,这些指令说明了如何执行计算。计算可能是数学上的,例如解决等式组或者计算多项式的平方根。但是也可以是符号计算,比如搜索替换文件的文本或者(非常奇怪)编译一个程序。 - -\index{程序} - -不同的语言有一些细节上的差异。但是他们有一些共有的指令: - -\begin{description} - -\item[输入:] 从键盘获取数据,文件,或者从其他设备。 - -\item[输出:] 在显示器上显示数据或者把数据输出到文件或其他设备。 - -\item[数学运算:] 做基本的数学操作像加法和乘法。 - -\item[条件执行:]检查条件,然后执行正确的语句。 - -\item[循环:]重复执行一些动作,通常有些变化。 - -\end{description} - -信不信由你,就是这样。我们用过的任何一个软件,无论多么复杂,基本上都是由与这些相似的指令组成。所以,我们可以这么理解:编程就是把复杂庞大的任务分解为一系列的小任务,知道这些小任务简单到可以用这些基本的指令表示。 - -\index{算法} - -这个有点模糊,但是当我们讲到算法的时候,我们再回过头来聊这个话题。 - -\section{什么是调试?} -\index{调试} -\index{臭虫} - -有三种错误经常在程序中出现:语法错误,运行时错误和语义错误。为了能够快速的跟踪捕捉到他们,区分他们之间的诧异还是很有好处的。 - -\subsection{语法错误} -\index{语法错误} -\index{错误!语法} -\index{错误信息} - -Python只能执行语法正确的程序;否则,解释器就会报错。语法指的是程序的结构和结构的规则。\index{syntax 语法} -比如,括号必须是成对出现,所以{\tt (1 + 2)}是合法的,但{\tt 8)}就是语法错误。 - -\index{parentheses!matching 括号!匹配} -\index{syntax 语法} -\index{cummings, e. e. 康明思} - -在英语中,读者可以忍受大多数语法错误,这就是为什么我们玩味E. E康明思的诗歌,而没有提出任何错误信息的原因。Python不会这么仁慈。如果在你程序的某个地方出现了哪怕是一个语法错误,Python也会显示错误信息然后退出,你也不能再继续执行程序。在你初学编程的几周里,你很可能会花费大量的时间追踪,捕捉语法错误。一旦你有经验了,你犯的错误就更少,并且也能很快的发现他们。 - -\subsection{运行时错误} -\label{runtime 运行时} -\index{runtime error 运行时错误} -\index{error!runtime 错误!运行时} -\index{exception 异常} -\index{safe language 安全语言} -\index{language!safe 语言!安全} - - -第二中错误是运行时错误,之所以这么命名是因为从这种错误知道程序开始运行才会出现。这些错误也叫做异常,因为他们通常表明异常的事情发生了。\\ - -运行时错误在前几章的简短的代码中比较少见,因此你可能会有一段时间才会遇到。 - -\section{语义错误} -\index{semantics 语义} -\index{semantics errors 语义错误} -\index{error!semantic 错误!语义} -\index{error message 错误信息} - -第三中错误是语义错误。如果有语义错误,程序会成功运行(即计算机不会产生任何的错误信息),但是它却没有做对!计算机做了另外的事。确切的说,计算机确实做了你告诉他的指令。 - -\subsection{试验性的调试} - -你必须拥有的一条技能是调试。尽管在这个过程中,你可能很受伤,但,调试是编程中最具有挑战,最有意思,最能考验智力的一部分。\\ - -\index{experimental debugging 实验性的调试} -\index{debugging!experimental 调试!实验} - -某种程度上,调试就像是侦探。你面对着很多线索,必须推断导致你看到的结果的过程和事件。\\ - -调试也像是一个科学实验。一旦你意识到错误的地方,改正她,再尝试。如果你的假想是正确的,你就可以预测出改变带来的结果,你也就离能够执行的程序更近一步了。如果你的猜想是错误的,你不得不提出一个新的。正如Sherlock Holmoes指出的,“当你移除了不可能的,留下来的无论是什么,也不论多么不可能,都是真理。(A. Conan Doyle, {\em The Sign of Four})\\ - -\index{Holems, Sherlock} -\index{Doyle, Arthur Conan} - -对某些人来说,编程和调试是同时完成的。也就是,编程是不断调试,直到看到想要结果的过程。理念就是:你必须以一个能够工作的程序开始,然后做些小改动,随着进度不断调试他们,这样就总是有一个可工作的程序。\\ - -比如:Linux是一个包含成千上万行代码的操作系统,但它也是从一个Linux Torvalds用来研究Intel 80386芯片的小程序开始的。按照Larry Greenfield的说法,“Linus的早期项目就是一个在打印AAAA和BBBB之间切换的程序。“({\em The Linux Users' Guide} Beta Version 1)。 - -\index{Linux} - -接下来的章节将介绍更多的调试建议还有其他的编程经验。 - -\section{正式语言和自然语言} -\index{formal language 正式语言} -\index{natural language 自然语言} -\index{language!formal 语言!正式} -\index{language!natural 语言!自然} - -自然语言是人们日常说的语言,比如英语,西班牙语和法语。他们不是人民设计的(尽管人们努力的强加一些规则);他们是自然发展的。\\ - -正式语言是人们为了特别的应用而设计的语言。比如,数学家使用的符号就是一门正式语言,它很擅长揭示数字和符号之间的联系。化学家用正式语言代表分子的化学结构。最重要的是: - -\begin{quote} -{编程语言是正式语言,是被设计来表达计算的。} -\end{quote} - -正式语言倾向于有严谨的语法规则。比如,$3 + 3 = 6$是语法争取的数学语句。但是$3 += 3 \mbox{\$} 6$ 不是。$H_2O$是语法正确的化学分子式,但$_2Zz$ 不是。\\ - -语法规则涉及到两个方面:标记和结构。标记是语言的最基本元素,比如字,数字和化学元素。$3 += 3 \mbox{\$} 6$的一个问题是$\$$不是一个合法的数学标记(至少据我所知)。相似的,$_2Zz$不合法是因为没有元素的缩写是$Zz$。 - -\index{token 标记} -\index{structure 结构} - -第二种语法错误涉及到语句的结构,也就是,标记被安排的方式。语句$3 + = 3 \mbox{\$} 6$是非法的因为尽管$+$和$=$是合法的标记,但我们不能把两个相连。同样的,在化学分子式中,下标必须在元素之后,不是前面。 - -\begin{ex} -写一个结构正确的英语句子,同时标记也必须合法。然后写一个结构不合理但是标记合法的句子。 -\end{ex} - -当阅读一个英文句子或者正式语言的一个语句,必须明确句子的结构(尽管对于自然语言来说,这个是潜意识的)。这个过程叫做句法分析。 - -\index{parse 句法分析} - -比如,当你听到一个句子,“一便士硬币掉了”,你理解“一便士硬币”是主语,“掉了”是谓语。一旦你分析了这个句子,你就明确句子的意思。假如你知道一个便士是什么,并且什么是掉了,你就会明白这个句子的一般含意。\\ - -尽管正式语言和自然语言有很多共同点---标记,结构,语法和语义---也存在一些不同点: - -\index{ambiguity 二义性} -\index{redundancy 冗余性} -\index{literalness 无修饰性} - -\begin{description} - -\item[二义性:]自然语言充满了二义性(模糊性),人们利用上下文来区分。正式语言被设计成近乎没有二义性,这也意味着每个语句都有明确的意思,无论上下文。 - -\item[冗余性:]为了弥补二义性和减少误解,自然语言设置了很多冗余。因此自然语言是冗长的。自然语言更简短,精确。 - -\item[无修饰性:]自然语言充满了习语和隐喻。如果我说“一便士硬币掉了”,也许根本没有便士也没有东西掉了\footnote{这个习语意思是某人困惑之后恍然大悟。}。正式语言表达了是精确的意思。 - -\end{description} - -成长过程中,说自然语言的人---每个人---通常在调整自己适应正式语言的过程中都会经历痛苦。某种程度上,正式语言和自然语言之间的区别就像诗歌和散文\footnote{译者:这里的散文不是诗化的散文,像余光中老前辈开启的诗化散文}之间的区别,甚至更多: - -\index{poetry 诗歌} -\index{prose 散文} - -\begin{description} - -\item[诗歌:]单词的运用既是为了语义的需要,也是为了音韵的需要,整首诗创造了一种情感共鸣。二义性不仅很常见,而且常常是故意安排的。 - -\item[散文:]单词的字面意思更加重要,结构也表达了更多的意思。散文比诗歌更容易分析,但是仍然具有二义性。 - -\item[程序:]计算机程序是无二义性。可以通过分析标记和结构完全理解。 - - -\end{description} - -这里给些读程序时候的一些建议(包括其他正式语言).第一,记住正式语言是比自然语言要晦涩的,所以要花长时间阅读。其次,结构也是非常重要的,所以,从头到位,从左到右阅读通常不是一个好的办法,可以学习在大脑中分析程序,识别标记的意思,然后解释结构。最后,细节也很重要。一些拼写和标点上细小的错误(在自然语言中可以忽略的),有时会在正式语言中掀起大浪。 - -\section{第一个程序} -\label{hello} -\index{Hello, World} - -通常,学习新语言的第一个程序就是"hello world", 应为所做的就是显示单词,"Hello , World!".在Python中,看起来是: - -\beforeverb -\begin{verbatim} -print 'Hello, World!' -\end{verbatim} -\afterverb - -这是一个print语句的例子\footnote{在Python3.0中,{\tt print}是一个函数,不是一个语句了,所以语法是{\tt print("Hello, World!")}。我们不久就要接触到函数了! 译注:在本书翻译时python 2.7 和python3.1已经发布,python 3.2的release 版也即将发布},没有真正在纸上打印东西。它在显示器上显示了一个值。在这种情况下,结果是单词 - -\index{Python 3.0} - -\beforeverb -\begin{verbatim} -Hello, World! -\end{verbatim} -\afterverb - -程序中的引号标志了要被显示的文本的开始和结束,他们不会出现在结果中。 - -\index{quotation mark 引号} -\index{print statement print 语句} -\index{statement!print 语句!打印} - -一些人通过"Hello, World!"程序的简洁程度来判断编程语言的好坏。按照这个标准,Python确实非常好! - - -\section{调试} -\index{debugging 调试} - -坐在电脑前面看这本书是个不错的方法,你可以随时尝试书中的例子。你可以在 -交互模式下运行大多数的程序,但是如果你把代码放在一个脚本里,也是很容易尝试改变一些内容的。\footnote{译者注:我的理解是,可以很方便的 -改动某些变量或者语句,然后执行}\\ - -无论何时,尝试一个新的特点的时候,你应该故意的犯些错误。比如,在"Hello, World!"程序中,如果忽略了双引号其中之一,会发生什么?如果把两个引号都忽略了,又会怎样?如果拼错了{\tt print}了呢?\\ - -\index{error message 错误信息} - -这种实验能够有效的帮助你记住你看的内容,同时也对调试有好处,因为你知道了错误信息的意思了。现在故意的犯错误总比以后猝不及防的犯错误要好的多。\\ - -编程,特别是调试,有时带来很强的情绪。你在一个困难的bug里苦苦挣扎,你可能变得怒不可遏,苦恼不堪,甚至羞愧不已。\\ - -有证据表明,人们很容易把电脑当成人来对待\footnote{参看Reeves和Nass,{\it The Media Equation:How People Treat Computers, Television, and New Media Like Real People and Places}.}.当电脑工作正常,我们把它们当作是队友,当电脑不给力时,我们把它们当成粗鲁顽固的人。\\ - -\index{debugging!emotional response 调试!情绪反应} -\index{emotional debugging 情绪调试} - -为这些反应作准备也许会帮助你合理的处理。一个方法是把电脑当作一个员工,他既拥有一定力量,比如速度和精度,也会有特别的缺点,比如缺少默契,没有能力理解大的图片。\\ - -你的工作就是做一个好的经理:发掘有效的方法扬长补短。并且寻找方法利用你的情绪来投入到解决问题中,不要让你的(不良)反应干扰你工作的能力.\\ - -学习调试是令人沮丧的,但是一种宝贵的技巧,在编程的其他领域也是大有裨益的。在每章的末尾,都有一个调试段落,像这个一样,是我调试经验的总结。我希望他们对你有益! - -\section{术语表} -\begin{description} - -\item[problem solving 问题解决:]表述问题,发现解,表达解的过程。 - -\item[high-level language 高级语言:]像Python一样的程序设计语言,被设计让人们易读易写程序。 - -\item[low-level language 低级语言:]设计让计算机容易执行的程序设计语言;也叫做“机器语言”或者“汇编语言”。 - -\item[portability 可移植性:]程序可以在一台或多台电脑执行的属性。 - -\item[interpret 解释:]逐行逐行解释执行用高级语言编写的程序。 - -\item[compile 编译:]把用高级语言编写的程序转换成低级语言。 -\index{compile 编译} - -\item[source code 源码:]未编译的高级语言编写的程序。 - -\item[object code 目标代码:] 编译器转换程序后的输出。 -\index{object code 目标代码} - -\item[executable 可执行代码:] 目标代码的别名,可以被执行。 -\item{executable 可执行代码} -\item[prompt 提示符:] 解释器显示的字符,表明做好准备让用户输入。 -\index{prompt 提示符} - -\item[script 脚本:]存储在文件中的程序。 -\index{script 脚本} - -\item[interactive mode 交互模式:] 一种通过输入命令和表达式的使用python解释器的方式。 -\index{interactive mode 交互模式} - -\item[script mode 脚本模式:] 一种使用Python解释器的方式,Python解释器读取脚本中的语句执行。 -\index{script mode 脚本模式} - -\item[program 程序:]指明计算的指令集合。 -\index{program 程序} - - -\item[algorithm 算法] 求解一类问题的通用过程。 -\index{algorithm} - -\item[bug:] 程序的错误。 -\index{bug} - -\item[debugging 调试:]发现,去除程序错误的过程。 -\index{debugging 调试} - -\item[syntax 语法] 程序的结构。 -\index{syntax 语法} - -\item[syntax error 语法错误:]使程序不能正确解析的错误。 -\index{syntax error} - - -\item[exception 异常:]程序在运行时发现的错误。 -\index{exception 异常} - -\item[semantics 语义:]程序的含意。 -\index{semantics 语义} - -\item[semantics error 语义错误:] 程序中的错误,使计算机执行另外的程序。 -\index{semantics error 语义错误} - -\item[natural language 自然语言:]人们日常交流用的语言,自然发展的。 -\index{natural language 自然语言} - -\item[formal language 正式语言:]人民为了某种特殊目的设计的语言,比如,代表数学思想或者计算机程序,所有的程序设计语言都是正式语言。 -\index{formal language 正式语言} - -\item[token 标记:]程序语法结构的最基本元素,类似于自然语言的单词。 -\index{token 标记} - -\item[parse 句法分析:]检查程序,分析语法结构。 -\index{parse 句法分析} - -\item[print statement print 语句:]一条指示Python解释器显示一个值的指令。 -\index{print statement print 语句} - -\index{statement!print 语句!打印} - -\end{description} - -\section{练习} - -\begin{ex} -打开浏览器浏览Python官网\url{python.org}.这个页面包含了Python的一些信息,还有和Python相关的连接。你可以查看Python官方文档。\\ - -比如,在搜索框里输入{\tt print},第一个链接就是{\tt print}语句的文档。此时,并不是所有的信息对你都有意义,但是知道它们在哪里总是有好处的。 - -\index{documentation 文档} -\index{python.org} -\end{ex} - -\begin{ex} -启动Python的解释器,输入{\tt help()}启动在线帮助工具。或者你也可以输入\verb"help('print')" 获得关于{\tt print}语句的信息。\\ - -如果没有成功,你或许需要安装额外的Python官方文档,或者设置环境变量。这个依赖于你使用的操作系统和Python解释器版本。 - -\index{help utility 帮助工具} -\end{ex} - - -\begin{ex} -打开Python解释器,我们暂且把它作为计算器。关于数学操作的语法,Python和标准的数学符号很相似。比如,符号{\tt +},{\tt -} 和{\tt /}表示加减,除。乘法的符号是{\tt *}。\\ - -如果43分钟30秒,跑了10公里,每英里花费的时间是多少?你的平均速度是多少英里每小时?(Hint:一英里等于1.61公里)。 - -\index{caculator 计算器} -\index{running pace 跑步速度} -\end{ex} - - - - +\input{part/chapter01} +\input{part/chapter02} +\input{part/chapter03} +\input{part/chapter04} +\input{part/chapter05} +\input{part/chapter06} +\input{part/chapter07} +\input{part/chapter08} +\input{part/chapter09} +\input{part/chapter10} +\input{part/chapter11} +\input{part/chapter12} +\input{part/chapter13} +\input{part/chapter14} +\input{part/chapter15} +\input{part/chapter16} +\input{part/chapter17} +\input{part/chapter18} +\input{part/chapter19} +\appendix +\input{part/appendix} \end{document} diff --git a/thinkpython/tex-zh/book.toc b/thinkpython/tex-zh/book.toc deleted file mode 100644 index fbb61f9..0000000 --- a/thinkpython/tex-zh/book.toc +++ /dev/null @@ -1,15 +0,0 @@ -\contentsline {chapter}{前言}{v} -\contentsline {section}{\numberline {0.1}本书的奇怪历史}{v} -\contentsline {chapter}{\numberline {1}编程的方式}{1} -\contentsline {section}{\numberline {1.1}Python编程语言}{1} -\contentsline {section}{\numberline {1.2}什么是程序}{2} -\contentsline {section}{\numberline {1.3}什么是调试?}{3} -\contentsline {subsection}{\numberline {1.3.1}语法错误}{3} -\contentsline {subsection}{\numberline {1.3.2}运行时错误}{3} -\contentsline {section}{\numberline {1.4}语义错误}{3} -\contentsline {subsection}{\numberline {1.4.1}试验性的调试}{3} -\contentsline {section}{\numberline {1.5}正式语言和自然语言}{4} -\contentsline {section}{\numberline {1.6}第一个程序}{5} -\contentsline {section}{\numberline {1.7}调试}{6} -\contentsline {section}{\numberline {1.8}术语表}{6} -\contentsline {section}{\numberline {1.9}练习}{7} diff --git a/thinkpython/tex-zh/part/appendix.tex b/thinkpython/tex-zh/part/appendix.tex new file mode 100644 index 0000000..19cb502 --- /dev/null +++ b/thinkpython/tex-zh/part/appendix.tex @@ -0,0 +1 @@ +\chapter{调试} diff --git a/thinkpython/tex-zh/part/chapter00.tex b/thinkpython/tex-zh/part/chapter00.tex new file mode 100644 index 0000000..a7c9b9b --- /dev/null +++ b/thinkpython/tex-zh/part/chapter00.tex @@ -0,0 +1,537 @@ + + +%LaTeXOnly + +\input{latexonly} + +\newtheorem{ex}{Exercise}[chapter] +\begin{latexonly} + +\renewcommand{\blankpage}{\thispagestyle{empty} \quad \newpage} + +%blankpage +%blankpage + +%-half title---------------------------------------------- +\thispagestyle{empty} +\begin{flushright} +\vspace*{2.0in} + +\begin{spacing}{3} +{\huge 思考Python}\\ +{\Large 像计算机科学家一样思考} +\end{spacing} + +\vspace{0.25in} + +Version \theversion + +\vfill +\end{flushright} + +%--------------------------- +\blankpage +\blankpage + +%---title page--------- +\pagebreak +\thispagestyle{empty} + +\begin{flushright} +\vspace*{2.0in} + +\begin{spacing}{3} +{\huge 思考Python}\\ +{\Large 像计算机科学家一样思考} +\end{spacing} + +\vspace{0.25in} +Version \theversion + +{\Large + Allen Downey\\ +} +{\Large + Walter Lewis\\ +} + + + +\vspace{0.5in} + +{\Large Green Tea Press}\\ +{\small Needham, Massachusetts} + +\vfill +\end{flushright} + +%---copyright------------------ +\pagebreak +\thispagestyle{empty} + +{\small + Copyright \copyright ~2008 Allen Downey. + +Printing history: + +\begin{description} + +\item[2002四月:] 第一版 {\em 像计算机科学家一样思考}. +\item[2007八月:] 大幅改动,把标题改为{\em 像(Python)程序员一样思考}. +\item[2008六月:] 大幅改动,把标题改为{\em 思考Python:像计算机科学家一样思考}. +\end{description} + +\vspace{0.2in} + +\begin{flushleft} %左对齐,类似的有flushright,centre +Green Tea Press \\ +9 Washburn Ave\\ +Needham MA 02492 +\end{flushleft} + + +Permission is granted to copy, distribute, and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and with no Back-Cover Texts. + +The GNU Free Documentation License is available from {\tt www.gnu.org} +or by writing to the Free Software Foundation, Inc., 59 Temple Place, +Suite 330, Boston, MA 02111-1307, USA. + +The original form of this book is \LaTeX\ source code. Compiling this +\LaTeX\ source has the effect of generating a device-independent +representation of a textbook, which can be converted to other formats +and printed. + +The \LaTeX\ source for this book is available from +\url{http://www.thinkpython.com} +\vspace{0.2in} +} + +\end{latexonly} + + +%htmlonly +\begin{htmlonly} + +%Title page for html version + +{\Large \thetitle} +\{\Large Allen B.Downet} +\{\Large 翻译:Walter Lewis} + +Version \theversion + +\setcounter{chapter}{-1} +\end{htmlonly} + +\chapter{前言} + +\section{本书的奇怪历史} + +1999年一月份的时候,我准备用Java教一门介绍性的编程课。在那之前,我已经 +教了三次,而且每次我都很失望。这门课的挂课率非常之高,尽管对那些通过的学 +生来说,整体的水平也是很低的。\\ + +我认为问题的根源之一是教科书。教科书太厚了,掺杂着大量不必要的Java细节 +内容,并且没有足够高水平的引导去指导学生如何编程。学生们深陷“陷阱门“:他们起步很轻松,逐步的学习,突然,大约在第五章的某个位置,困难出现了。学生必须快速的学习大量的新内容。结果,我不得不把剩下的学期花在挑选一些片段来教学。\\ + +课程开始的前两周,我决定自力更生--自己编写书。我的目标是: +\begin{itemize} + +\item 尽量简短.对学生来说,阅读十页比阅读无十页要好。 + +\item 注意词汇量。我尽量减少使用术语,而且在使用前必须先定义。 + +\item 逐步学习。为了避免陷阱门,我把最难的部分分解成一系列的小步骤。 + +\item 把重心放在编程,而不是编程语言。我采用最少的有用的Java语言的语法, +忽略其他的。 +\end{itemize} + +我需要一个书名,所以我就临时地把它叫做《像计算机科学家一样思考》\\ + +第一版很粗糙,但是很成功。学生们很乐意看它,并且能很好理解我在课堂上讲的难点,趣点和让他们实践的内容(这个最重要).\\ + +我用GNU自由文档许可证发布了这本书,读者们可以自由的复制,修改,发布这本书。 \\ + +\index{GNU Free Documentation License} +\index{Free Documentation License,GNU} + + 接下来发生的事儿极其的有趣。Jeff Elkner,居住在弗尼亚的高中老师,改变了我的书,把它翻译成了Python。他给我寄了份他翻译的副本,于是乎我就有了一段不寻常的学习Python的经历--通过阅读我自己的书。\\ + + Jeff和我随后修订了这本书,加入了Chris Meyers提供的一个案例学习。在2001年,我们共同发布了《像计算机科学家一样思考:Python编程》,当然同样是用GNU自由文档许可证。通过Gree Tea Press,我出版了这本书,并且开始在亚马逊和大学书店卖纸质书。Gree Tea Press出版的书可以从这儿获得\url{greenteapress.com}\\ + + 2003年,我开始在Olin College教书。第一次,我开始教Python。和教授Java的情况相反,学生们不再陷入泥潭,学到了更多,参与了很多有趣的项目,越学越带劲。\\ + + 在过去的五年里,我一直继续完善这本书,改正错误,提过某些例子的质量,加入一些其他的材料,特别是练习。在2008年,我开始重写这本书---同时,剑桥大学出版社的编辑联系到了我,他想出版本书的下一板。美妙的时刻!\\ + + 结构就出现了现在的这本书,不过有了一个简洁的名字《思考Python》。变化有: + \begin{itemize} + + \item 在每一章末尾加了点调试的部分。这些部分提供了发现和避免bug的通用技巧,也对Python的陷阱提出了警告。 + + \item 删除了最后几章关于列表和树实现的内容。虽然,我万分不舍,但是考虑到和本书余下的部分不协调,只能忍痛割爱。 + + \item 增加了一些案例学习---提供了练习,答案和相关讨论的大例子。一些东西是基于Swampy,这是我为了教学而设计的Python程序。 + Swampy,代码实例和部分答案可以从这儿获得\url{thinkpython.com}. + + \item 扩展了关于程序构建计划和基本的设计模式的讨论。 + + \item Python运用的更加地道。虽然这本书仍然是讨论编程的,而不是Python本身,但是现在我不得不承认这本书深受Python浸染。 + + \end{itemize} + + 我希望读者们可以享受这本书,也希望帮助你学习程序设计和像计算机科学家一样思考,哪怕是一丁丁点儿。\\ + +Allen B. Downey\\ +Needham MA\\ + +Allen Downey 是Olin College 大学计算机科学与技术系的副教授。 + + + +\section*{声明} + +首先,也是最重要的,我要感谢Jeff Elkner,是他把我的Java书翻译成了Python,也由此开启了这项“工程“,也把我领进了我最爱的编程语言大门。\\ + +我也要感谢Chris Meyers,他贡献了《像计算机科学家一样思考》的部分内容。\\ + +感谢FSF制定的GNU自由文档许可证,使我和Jeff 和Chris 的合作成为可能。\\ + +\index{GNU Free Documentation License} +\index{Free Documentation License,GNU} + +我也要感谢所以使用以前版本的学生和所有的贡献者,他们提供了宝贵的更正和建议2。\\ + +感谢我的妻子,Lisa为她在这本书上所花费的努力,还有Gree Tea Press,和其他的一切。 + +\section*{贡献者名单} + +\index{贡献者} + +More than 100 sharp-eyed and thoughtful readers have sent in +suggestions and corrections over the past few years. Their +contributions, and enthusiasm for this project, have been a +huge help. + +If you have a suggestion or correction, please send email to +{\tt feedback@thinkpython.com}. If I make a change based on your +feedback, I will add you to the contributor list +(unless you ask to be omitted). + +If you include at least part of the sentence the +error appears in, that makes it easy for me to search. Page and +section numbers are fine, too, but not quite as easy to work with. +Thanks! + +\small + +\begin{itemize} + +\item Lloyd Hugh Allen sent in a correction to Section 8.4. + +\item Yvon Boulianne sent in a correction of a semantic error in +Chapter 5. + +\item Fred Bremmer submitted a correction in Section 2.1. + +\item Jonah Cohen wrote the Perl scripts to convert the +LaTeX source for this book into beautiful HTML. + +\item Michael Conlon sent in a grammar correction in Chapter 2 +and an improvement in style in Chapter 1, and he initiated discussion +on the technical aspects of interpreters. + +\item Benoit Girard sent in a +correction to a humorous mistake in Section 5.6. + +\item Courtney Gleason and Katherine Smith wrote {\tt horsebet.py}, +which was used as a case study in an earlier version of the book. Their +program can now be found on the website. + +\item Lee Harr submitted more corrections than we have room to list +here, and indeed he should be listed as one of the principal editors +of the text. + +\item James Kaylin is a student using the text. He has submitted +numerous corrections. + +\item David Kershaw fixed the broken {\tt catTwice} function in Section +3.10. + +\item Eddie Lam has sent in numerous corrections to Chapters +1, 2, and 3. +He also fixed the Makefile so that it creates an index the first time it is +run and helped us set up a versioning scheme. + +\item Man-Yong Lee sent in a correction to the example code in +Section 2.4. + +\item David Mayo pointed out that the word ``unconsciously" +in Chapter 1 needed +to be changed to ``subconsciously". + +\item Chris McAloon sent in several corrections to Sections 3.9 and +3.10. + +\item Matthew J. Moelter has been a long-time contributor who sent +in numerous corrections and suggestions to the book. + +\item Simon Dicon Montford reported a missing function definition and +several typos in Chapter 3. He also found errors in the {\tt increment} +function in Chapter 13. + +\item John Ouzts corrected the definition of ``return value" +in Chapter 3. + +\item Kevin Parks sent in valuable comments and suggestions as to how +to improve the distribution of the book. + +\item David Pool sent in a typo in the glossary of Chapter 1, as well +as kind words of encouragement. + +\item Michael Schmitt sent in a correction to the chapter on files +and exceptions. + +\item Robin Shaw pointed out an error in Section 13.1, where the +printTime function was used in an example without being defined. + +\item Paul Sleigh found an error in Chapter 7 and a bug in Jonah Cohen's +Perl script that generates HTML from LaTeX. + +\item Craig T. Snydal is testing the text in a course at Drew +University. He has contributed several valuable suggestions and corrections. + +\item Ian Thomas and his students are using the text in a programming +course. They are the first ones to test the chapters in the latter half +of the book, and they have made numerous corrections and suggestions. + +\item Keith Verheyden sent in a correction in Chapter 3. + +\item Peter Winstanley let us know about a longstanding error in +our Latin in Chapter 3. + +\item Chris Wrobel made corrections to the code in the chapter on +file I/O and exceptions. + +\item Moshe Zadka has made invaluable contributions to this project. +In addition to writing the first draft of the chapter on Dictionaries, he +provided continual guidance in the early stages of the book. + +\item Christoph Zwerschke sent several corrections and +pedagogic suggestions, and explained the difference between {\em gleich} +and {\em selbe}. + +\item James Mayer sent us a whole slew of spelling and +typographical errors, including two in the contributor list. + +\item Hayden McAfee caught a potentially confusing inconsistency +between two examples. + +\item Angel Arnal is part of an international team of translators +working on the Spanish version of the text. He has also found several +errors in the English version. + +\item Tauhidul Hoque and Lex Berezhny created the illustrations +in Chapter 1 and improved many of the other illustrations. + +\item Dr. Michele Alzetta caught an error in Chapter 8 and sent +some interesting pedagogic comments and suggestions about Fibonacci +and Old Maid. + +\item Andy Mitchell caught a typo in Chapter 1 and a broken example +in Chapter 2. + +\item Kalin Harvey suggested a clarification in Chapter 7 and +caught some typos. + +\item Christopher P. Smith caught several typos and helped us +update the book for Python 2.2. + +\item David Hutchins caught a typo in the Foreword. + +\item Gregor Lingl is teaching Python at a high school in Vienna, +Austria. He is working on a German translation of the book, +and he caught a couple of bad errors in Chapter 5. + +\item Julie Peters caught a typo in the Preface. + +\item Florin Oprina sent in an improvement in {\tt makeTime}, +a correction in {\tt printTime}, and a nice typo. + +\item D.~J.~Webre suggested a clarification in Chapter 3. + +\item Ken found a fistful of errors in Chapters 8, 9 and 11. + +\item Ivo Wever caught a typo in Chapter 5 and suggested a clarification +in Chapter 3. + +\item Curtis Yanko suggested a clarification in Chapter 2. + +\item Ben Logan sent in a number of typos and problems with translating +the book into HTML. + +\item Jason Armstrong saw the missing word in Chapter 2. + +\item Louis Cordier noticed a spot in Chapter 16 where the code +didn't match the text. + +\item Brian Cain suggested several clarifications in Chapters 2 and 3. + +\item Rob Black sent in a passel of corrections, including some +changes for Python 2.2. + +\item Jean-Philippe Rey at Ecole Centrale +Paris sent a number of patches, including some updates for Python 2.2 +and other thoughtful improvements. + +\item Jason Mader at George Washington University made a number +of useful suggestions and corrections. + +\item Jan Gundtofte-Bruun reminded us that ``a error'' is an error. + +\item Abel David and Alexis Dinno reminded us that the plural of +``matrix'' is ``matrices'', not ``matrixes''. This error was in the +book for years, but two readers with the same initials reported it on +the same day. Weird. + +\item Charles Thayer encouraged us to get rid of the semi-colons +we had put at the ends of some statements and to clean up our +use of ``argument'' and ``parameter''. + +\item Roger Sperberg pointed out a twisted piece of logic in Chapter 3. + +\item Sam Bull pointed out a confusing paragraph in Chapter 2. + +\item Andrew Cheung pointed out two instances of ``use before def.'' + +\item C. Corey Capel spotted the missing word in the Third Theorem +of Debugging and a typo in Chapter 4. + +\item Alessandra helped clear up some Turtle confusion. + +\item Wim Champagne found a brain-o in a dictionary example. + +\item Douglas Wright pointed out a problem with floor division in +{\tt arc}. + +\item Jared Spindor found some jetsam at the end of a sentence. + +\item Lin Peiheng sent a number of very helpful suggestions. + +\item Ray Hagtvedt sent in two errors and a not-quite-error. + +\item Torsten H\"{u}bsch pointed out an inconsistency in Swampy. + +\item Inga Petuhhov corrected an example in Chapter 14. + +\item Arne Babenhauserheide sent several helpful corrections. + +\item Mark E. Casida is is good at spotting repeated words. + +\item Scott Tyler filled in a that was missing. And then sent in +a heap of corrections. + +\item Gordon Shephard sent in several corrections, all in separate +emails. + +\item Andrew Turner {\tt spot}ted an error in Chapter 8. + +\item Adam Hobart fixed a problem with floor division in {\tt arc}. + +\item Daryl Hammond and Sarah Zimmerman pointed out that I served +up {\tt math.pi} too early. And Zim spotted a typo. + +\item George Sass found a bug in a Debugging section. + +\item Brian Bingham suggested Exercise~\ref{exrotatepairs}. + +\item Leah Engelbert-Fenton pointed out that I used {\tt tuple} +as a variable name, contrary to my own advice. And then found +a bunch of typos and a ``use before def.'' + +\item Joe Funke spotted a typo. + +\item Chao-chao Chen found an inconsistency in the Fibonacci example. + +\item Jeff Paine knows the difference between space and spam. + +\item Lubos Pintes sent in a typo. + +\item Gregg Lind and Abigail Heithoff suggested Exercise~\ref{checksum}. + +\item Max Hailperin has sent in a number of corrections and + suggestions. Max is one of the authors of the extraordinary {\em + Concrete Abstractions}, which you might want to read when you are + done with this book. + +\item Chotipat Pornavalai found an error in an error message. + +\item Stanislaw Antol sent a list of very helpful suggestions. + +\item Eric Pashman sent a number of corrections for Chapters 4--11. + +\item Miguel Azevedo found some typos. + +\item Jianhua Liu sent in a long list of corrections. + +\item Nick King found a missing word. + +\item Martin Zuther sent a long list of suggestions. + +\item Adam Zimmerman found an inconsistency in my instance +of an ``instance'' and several other errors. + +\item Ratnakar Tiwari suggested a footnote explaining degenerate +triangles. + +\item Anurag Goel suggested another solution for \verb"is_abecedarian" +and sent some additional corrections. And he knows how to +spell Jane Austen. + +\item Kelli Kratzer spotted one of the typos. + +\item Mark Griffiths pointed out a confusing example in Chapter 3. + +\item Roydan Ongie found an error in my Newton's method. + +\item Patryk Wolowiec helped me with a problem in the HTML version. + +\item Mark Chonofsky told me about a new keyword in Python 3.0. + +\item Russell Coleman helped me with my geometry. + +\item Wei Huang spotted several typographical errors. + +\item Karen Barber spotted the the oldest typo in the book. + +\item Nam Nguyen found a typo and pointed out that I used the Decorator +pattern but didn't mention it by name. + +\item St\'{e}phane Morin sent in several corrections and suggestions. + +\item Paul Stoop corrected a typo in \verb+uses_only+. + +\item Eric Bronner pointed out a confusion in the discussion of the +order of operations. + +\item Alexandros Gezerlis set a new standard for the number and +quality of suggestions he submitted. We are deeply grateful! + +% ENDCONTRIB + +\end{itemize} + + +\normalsize +\clearemptydoublepage + +\begin{latexonly} + +\tableofcontents + +\clearemptydoublepage + +\end{latexonly} diff --git a/thinkpython/tex-zh/part/chapter01.tex b/thinkpython/tex-zh/part/chapter01.tex new file mode 100644 index 0000000..0677c4d --- /dev/null +++ b/thinkpython/tex-zh/part/chapter01.tex @@ -0,0 +1,435 @@ +\chapter{编程的方式} + +这本书的的目的是教会大家如何像计算机科学家一样思考。计算机科学用严谨的语言来表明思想,尤其是计算。像工程师,他们设计,把各个组件装配成系统并且在可选方案中评估出折中方案。像科学家,他们研究复杂系统的性能,做出假定并且测试假设。 + + +\index{解决问题} + +对一个计算机科学家来说最重要的是解决问题。解决问题意味着清晰明确的阐述问题,积极思考问题答案,并且清楚正确的表达答案的能力。实践证明:学习如何编程是一种很好的机会来练习解决问题的技巧。这也是为什么把这章叫做“编程的方式“。\\ + +一方面,你将学习编程,一个非常有用的技巧。另一方面你将会把编程作为一种科技。随着我们的深入学习,这点会渐渐明晰。 + +\section{Python编程语言} +\index{编程语言} +\index{语言!编程} + +我们将要学习的编程语言是Python。Python仅是高级语言中的一种,你可能 +也听说过其他的高级编程语言,比如C,C++,Perl,和Java。\\ + +也有一些低级语言,有时也被称为机器语言或者汇编语言。一般来说,计算机 +只能执行用低级语言编写的程序。所以,用高级语言编写的程序在执行前必须 +做相应的处理。这会花费一定的时间,同时这也是高级语言的“缺点“。\\ + +\index{移植性} +\index{高级语言} +\index{低级语言} +\index{语言!高级} +\index{语言!低级} + +然而,高级语言的优点也是无限的。首先,用高级语言编程是一件非常容易的。 +用高级语言编程通常花费的时间比较少,同时编写的程序简短,易读,易纠错 +。第二,高级语言是可移植的,这意味着他们可以不加修改(或者修改很少)地运行在不同的平台上。低级语言编写的程序只能在一个机器上运行,如果想 +要运行在另外一台机器上,必须得重写。\\ + +基于这些优点,几乎所有的程序都是用高级语言编写的。低级语言统称仅仅用 +在一些专门的应用程序中。 + +\index{complie} +\index{interpret} + +有两种程序把高级语言“处理”成低级语言:解释器和编译器。解释器读取源程序,解释执行,也就是按照程序表达的意思"做事"。解释器一次解释一点,或者说,一次读取一行,然后执行。\\ + +\beforefig +\centerline{\includegraphics[height=0.77in]{figs/interpret.eps}} +\afterfig + +\index{源码} +\index{目标} +\index{可执行代码} + +编译器读取程序,完全转换之。在这种情况下,高级语言程序叫做源码,编译后的程序叫做目标代码或者叫可执行代码。一旦程序被编译,就可以直接执行,无须再编译。 + +\beforefig +\centerline{\includegraphics[height=0.77in]{figs/compile.eps}} +\afterfig + +一般地,我们把python当作是解释型语言,因为用Python编写的程序是通过 +解释器执行的。有两种使用解释器的方式:交互模式和脚本模式。在交互模式 +下,你可以输入Python程序,然后解释器输出结果: + +\index{交互模式} +\index{脚本模式} + +\beforeverb +\begin{verbatim} +>>>1 + 1 +2 +\end{verbatim} %直接输出以上两句,包括空白和断行 +\afterverb + +锯齿符,{\tt >>>},是提示符,解释器用它来表明自己已经准备好了, +如果你输入{\tt 1 + 1},解释器显示{\tt 2}。\\ + +\index{提示符} + +另外地,我们可以把代码存储在一个文件里,使用解释器执行文件,此时这个 +文件被称作脚本。习惯上,Python脚本的扩展名为{\tt .py}。 + +\index{脚本} + +如果要执行Python脚本,我们必须提供给解释器脚本的文件名。在UNIX命令窗口,可以输入{\tt python dinsdale.py}。在其他开发环境中,会有些细节方面的差别。可以在Python官网上(\url{python.org})找到相应的指导。 + +\index{测试!交互模式} + +在交互模式下工作很容易测试一小段代码,因为可以随时输入,并且立刻执行。但如果代码量较大,我们必须把代码存放在脚本里,这样方便我们以后修改执行。 + +\section{什么是程序} + +程序就是指令集合,这些指令说明了如何执行计算。计算可能是数学上的,例如解决等式组或者计算多项式的平方根。但是也可以是符号计算,比如搜索替换文件的文本或者(非常奇怪)编译一个程序。 + +\index{程序} + +不同的语言有一些细节上的差异。但是他们有一些共有的指令: + +\begin{description} + +\item[输入:] 从键盘获取数据,文件,或者从其他设备。 + +\item[输出:] 在显示器上显示数据或者把数据输出到文件或其他设备。 + +\item[数学运算:] 做基本的数学操作像加法和乘法。 + +\item[条件执行:]检查条件,然后执行正确的语句。 + +\item[循环:]重复执行一些动作,通常有些变化。 + +\end{description} + +信不信由你,就是这样。我们用过的任何一个软件,无论多么复杂,基本上都是由与这些相似的指令组成。所以,我们可以这么理解:编程就是把复杂庞大的任务分解为一系列的小任务,知道这些小任务简单到可以用这些基本的指令表示。 + +\index{算法} + +这个有点模糊,但是当我们讲到算法的时候,我们再回过头来聊这个话题。 + +\section{什么是调试?} +\index{调试} +\index{臭虫} + +有三种错误经常在程序中出现:语法错误,运行时错误和语义错误。为了能够快速的跟踪捕捉到他们,区分他们之间的诧异还是很有好处的。 + +\subsection{语法错误} +\index{语法错误} +\index{错误!语法} +\index{错误信息} + +Python只能执行语法正确的程序;否则,解释器就会报错。语法指的是程序的结构和结构的规则。\index{syntax 语法} +比如,括号必须是成对出现,所以{\tt (1 + 2)}是合法的,但{\tt 8)}就是语法错误。 + +\index{parentheses!matching 括号!匹配} +\index{syntax 语法} +\index{cummings, e. e. 康明思} + +在英语中,读者可以忍受大多数语法错误,这就是为什么我们玩味E. E康明思的诗歌,而没有提出任何错误信息的原因。Python不会这么仁慈。如果在你程序的某个地方出现了哪怕是一个语法错误,Python也会显示错误信息然后退出,你也不能再继续执行程序。在你初学编程的几周里,你很可能会花费大量的时间追踪,捕捉语法错误。一旦你有经验了,你犯的错误就更少,并且也能很快的发现他们。 + +\subsection{运行时错误} +\label{runtime 运行时} +\index{runtime error 运行时错误} +\index{error!runtime 错误!运行时} +\index{exception 异常} +\index{safe language 安全语言} +\index{language!safe 语言!安全} + + +第二中错误是运行时错误,之所以这么命名是因为从这种错误知道程序开始运行才会出现。这些错误也叫做异常,因为他们通常表明异常的事情发生了。\\ + +运行时错误在前几章的简短的代码中比较少见,因此你可能会有一段时间才会遇到。 + +\section{语义错误} +\index{semantics 语义} +\index{semantics errors 语义错误} +\index{error!semantic 错误!语义} +\index{error message 错误信息} + +第三中错误是语义错误。如果有语义错误,程序会成功运行(即计算机不会产生任何的错误信息),但是它却没有做对!计算机做了另外的事。确切的说,计算机确实做了你告诉他的指令。 + +\subsection{试验性的调试} + +你必须拥有的一条技能是调试。尽管在这个过程中,你可能很受伤,但,调试是编程中最具有挑战,最有意思,最能考验智力的一部分。\\ + +\index{experimental debugging 实验性的调试} +\index{debugging!experimental 调试!实验} + +某种程度上,调试就像是侦探。你面对着很多线索,必须推断导致你看到的结果的过程和事件。\\ + +调试也像是一个科学实验。一旦你意识到错误的地方,改正她,再尝试。如果你的假想是正确的,你就可以预测出改变带来的结果,你也就离能够执行的程序更近一步了。如果你的猜想是错误的,你不得不提出一个新的。正如Sherlock Holmoes指出的,“当你移除了不可能的,留下来的无论是什么,也不论多么不可能,都是真理。(A. Conan Doyle, {\em The Sign of Four})\\ + +\index{Holems, Sherlock} +\index{Doyle, Arthur Conan} + +对某些人来说,编程和调试是同时完成的。也就是,编程是不断调试,直到看到想要结果的过程。理念就是:你必须以一个能够工作的程序开始,然后做些小改动,随着进度不断调试他们,这样就总是有一个可工作的程序。\\ + +比如:Linux是一个包含成千上万行代码的操作系统,但它也是从一个Linux Torvalds用来研究Intel 80386芯片的小程序开始的。按照Larry Greenfield的说法,“Linus的早期项目就是一个在打印AAAA和BBBB之间切换的程序。“({\em The Linux Users' Guide} Beta Version 1)。 + +\index{Linux} + +接下来的章节将介绍更多的调试建议还有其他的编程经验。 + +\section{正式语言和自然语言} +\index{formal language 正式语言} +\index{natural language 自然语言} +\index{language!formal 语言!正式} +\index{language!natural 语言!自然} + +自然语言是人们日常说的语言,比如英语,西班牙语和法语。他们不是人民设计的(尽管人们努力的强加一些规则);他们是自然发展的。\\ + +正式语言是人们为了特别的应用而设计的语言。比如,数学家使用的符号就是一门正式语言,它很擅长揭示数字和符号之间的联系。化学家用正式语言代表分子的化学结构。最重要的是: + +\begin{quote} +{编程语言是正式语言,是被设计来表达计算的。} +\end{quote} + +正式语言倾向于有严谨的语法规则。比如,$3 + 3 = 6$是语法争取的数学语句。但是$3 += 3 \mbox{\$} 6$ 不是。$H_2O$是语法正确的化学分子式,但$_2Zz$ 不是。\\ + +语法规则涉及到两个方面:标记和结构。标记是语言的最基本元素,比如字,数字和化学元素。$3 += 3 \mbox{\$} 6$的一个问题是$\$$不是一个合法的数学标记(至少据我所知)。相似的,$_2Zz$不合法是因为没有元素的缩写是$Zz$。 + +\index{token 标记} +\index{structure 结构} + +第二种语法错误涉及到语句的结构,也就是,标记被安排的方式。语句$3 + = 3 \mbox{\$} 6$是非法的因为尽管$+$和$=$是合法的标记,但我们不能把两个相连。同样的,在化学分子式中,下标必须在元素之后,不是前面。 + +\begin{ex} +写一个结构正确的英语句子,同时标记也必须合法。然后写一个结构不合理但是标记合法的句子。 +\end{ex} + +当阅读一个英文句子或者正式语言的一个语句,必须明确句子的结构(尽管对于自然语言来说,这个是潜意识的)。这个过程叫做句法分析。 + +\index{parse 句法分析} + +比如,当你听到一个句子,“一便士硬币掉了”,你理解“一便士硬币”是主语,“掉了”是谓语。一旦你分析了这个句子,你就明确句子的意思。假如你知道一个便士是什么,并且什么是掉了,你就会明白这个句子的一般含意。\\ + +尽管正式语言和自然语言有很多共同点---标记,结构,语法和语义---也存在一些不同点: + +\index{ambiguity 二义性} +\index{redundancy 冗余性} +\index{literalness 无修饰性} + +\begin{description} + +\item[二义性:]自然语言充满了二义性(模糊性),人们利用上下文来区分。正式语言被设计成近乎没有二义性,这也意味着每个语句都有明确的意思,无论上下文。 + +\item[冗余性:]为了弥补二义性和减少误解,自然语言设置了很多冗余。因此自然语言是冗长的。自然语言更简短,精确。 + +\item[无修饰性:]自然语言充满了习语和隐喻。如果我说“一便士硬币掉了”,也许根本没有便士也没有东西掉了\footnote{这个习语意思是某人困惑之后恍然大悟。}。正式语言表达了是精确的意思。 + +\end{description} + +成长过程中,说自然语言的人---每个人---通常在调整自己适应正式语言的过程中都会经历痛苦。某种程度上,正式语言和自然语言之间的区别就像诗歌和散文\footnote{译者:这里的散文不是诗化的散文,像余光中老前辈开启的诗化散文}之间的区别,甚至更多: + +\index{poetry 诗歌} +\index{prose 散文} + +\begin{description} + +\item[诗歌:]单词的运用既是为了语义的需要,也是为了音韵的需要,整首诗创造了一种情感共鸣。二义性不仅很常见,而且常常是故意安排的。 + +\item[散文:]单词的字面意思更加重要,结构也表达了更多的意思。散文比诗歌更容易分析,但是仍然具有二义性。 + +\item[程序:]计算机程序是无二义性。可以通过分析标记和结构完全理解。 + + +\end{description} + +这里给些读程序时候的一些建议(包括其他正式语言).第一,记住正式语言是比自然语言要晦涩的,所以要花长时间阅读。其次,结构也是非常重要的,所以,从头到位,从左到右阅读通常不是一个好的办法,可以学习在大脑中分析程序,识别标记的意思,然后解释结构。最后,细节也很重要。一些拼写和标点上细小的错误(在自然语言中可以忽略的),有时会在正式语言中掀起大浪。 + +\section{第一个程序} +\label{hello} +\index{Hello, World} + +通常,学习新语言的第一个程序就是"hello world", 应为所做的就是显示单词,"Hello , World!".在Python中,看起来是: + +\beforeverb +\begin{verbatim} +print 'Hello, World!' +\end{verbatim} +\afterverb + +这是一个print语句的例子\footnote{在Python3.0中,{\tt print}是一个函数,不是一个语句了,所以语法是{\tt print("Hello, World!")}。我们不久就要接触到函数了! 译注:在本书翻译时python 2.7 和python3.1已经发布,python 3.2的release 版也即将发布},没有真正在纸上打印东西。它在显示器上显示了一个值。在这种情况下,结果是单词 + +\index{Python 3.0} + +\beforeverb +\begin{verbatim} +Hello, World! +\end{verbatim} +\afterverb + +程序中的引号标志了要被显示的文本的开始和结束,他们不会出现在结果中。 + +\index{quotation mark 引号} +\index{print statement print 语句} +\index{statement!print 语句!打印} + +一些人通过"Hello, World!"程序的简洁程度来判断编程语言的好坏。按照这个标准,Python确实非常好! + + +\section{调试} +\index{debugging 调试} + +坐在电脑前面看这本书是个不错的方法,你可以随时尝试书中的例子。你可以在 +交互模式下运行大多数的程序,但是如果你把代码放在一个脚本里,也是很容易尝试改变一些内容的。\footnote{译者注:我的理解是,可以很方便的 +改动某些变量或者语句,然后执行}\\ + +无论何时,尝试一个新的特点的时候,你应该故意的犯些错误。比如,在"Hello, World!"程序中,如果忽略了双引号其中之一,会发生什么?如果把两个引号都忽略了,又会怎样?如果拼错了{\tt print}了呢?\\ + +\index{error message 错误信息} + +这种实验能够有效的帮助你记住你看的内容,同时也对调试有好处,因为你知道了错误信息的意思了。现在故意的犯错误总比以后猝不及防的犯错误要好的多。\\ + +编程,特别是调试,有时带来很强的情绪。你在一个困难的bug里苦苦挣扎,你可能变得怒不可遏,苦恼不堪,甚至羞愧不已。\\ + +有证据表明,人们很容易把电脑当成人来对待\footnote{参看Reeves和Nass,{\it The Media Equation:How People Treat Computers, Television, and New Media Like Real People and Places}.}.当电脑工作正常,我们把它们当作是队友,当电脑不给力时,我们把它们当成粗鲁顽固的人。\\ + +\index{debugging!emotional response 调试!情绪反应} +\index{emotional debugging 情绪调试} + +为这些反应作准备也许会帮助你合理的处理。一个方法是把电脑当作一个员工,他既拥有一定力量,比如速度和精度,也会有特别的缺点,比如缺少默契,没有能力理解大的图片。\\ + +你的工作就是做一个好的经理:发掘有效的方法扬长补短。并且寻找方法利用你的情绪来投入到解决问题中,不要让你的(不良)反应干扰你工作的能力.\\ + +学习调试是令人沮丧的,但是一种宝贵的技巧,在编程的其他领域也是大有裨益的。在每章的末尾,都有一个调试段落,像这个一样,是我调试经验的总结。我希望他们对你有益! + +\section{术语表} +\begin{description} + +\item[problem solving 问题解决:]表述问题,发现解,表达解的过程。 + +\item[high-level language 高级语言:]像Python一样的程序设计语言,被设计让人们易读易写程序。 + +\item[low-level language 低级语言:]设计让计算机容易执行的程序设计语言;也叫做“机器语言”或者“汇编语言”。 + +\item[portability 可移植性:]程序可以在一台或多台电脑执行的属性。 + +\item[interpret 解释:]逐行逐行解释执行用高级语言编写的程序。 + +\item[compile 编译:]把用高级语言编写的程序转换成低级语言。 +\index{compile 编译} + +\item[source code 源码:]未编译的高级语言编写的程序。 + +\item[object code 目标代码:] 编译器转换程序后的输出。 +\index{object code 目标代码} + +\item[executable 可执行代码:] 目标代码的别名,可以被执行。 +\item{executable 可执行代码} +\item[prompt 提示符:] 解释器显示的字符,表明做好准备让用户输入。 +\index{prompt 提示符} + +\item[script 脚本:]存储在文件中的程序。 +\index{script 脚本} + +\item[interactive mode 交互模式:] 一种通过输入命令和表达式的使用python解释器的方式。 +\index{interactive mode 交互模式} + +\item[script mode 脚本模式:] 一种使用Python解释器的方式,Python解释器读取脚本中的语句执行。 +\index{script mode 脚本模式} + +\item[program 程序:]指明计算的指令集合。 +\index{program 程序} + + +\item[algorithm 算法] 求解一类问题的通用过程。 +\index{algorithm} + +\item[bug:] 程序的错误。 +\index{bug} + +\item[debugging 调试:]发现,去除程序错误的过程。 +\index{debugging 调试} + +\item[syntax 语法] 程序的结构。 +\index{syntax 语法} + +\item[syntax error 语法错误:]使程序不能正确解析的错误。 +\index{syntax error} + + +\item[exception 异常:]程序在运行时发现的错误。 +\index{exception 异常} + +\item[semantics 语义:]程序的含意。 +\index{semantics 语义} + +\item[semantics error 语义错误:] 程序中的错误,使计算机执行另外的程序。 +\index{semantics error 语义错误} + +\item[natural language 自然语言:]人们日常交流用的语言,自然发展的。 +\index{natural language 自然语言} + +\item[formal language 正式语言:]人民为了某种特殊目的设计的语言,比如,代表数学思想或者计算机程序,所有的程序设计语言都是正式语言。 +\index{formal language 正式语言} + +\item[token 标记:]程序语法结构的最基本元素,类似于自然语言的单词。 +\index{token 标记} + +\item[parse 句法分析:]检查程序,分析语法结构。 +\index{parse 句法分析} + +\item[print statement print 语句:]一条指示Python解释器显示一个值的指令。 +\index{print statement print 语句} + +\index{statement!print 语句!打印} + +\end{description} + +\section{练习} + +\begin{ex} +打开浏览器浏览Python官网\url{python.org}.这个页面包含了Python的一些信息,还有和Python相关的连接。你可以查看Python官方文档。\\ + +比如,在搜索框里输入{\tt print},第一个链接就是{\tt print}语句的文档。此时,并不是所有的信息对你都有意义,但是知道它们在哪里总是有好处的。 + +\index{documentation 文档} +\index{python.org} +\end{ex} + +\begin{ex} +启动Python的解释器,输入{\tt help()}启动在线帮助工具。或者你也可以输入\verb"help('print')" 获得关于{\tt print}语句的信息。\\ + +如果没有成功,你或许需要安装额外的Python官方文档,或者设置环境变量。这个依赖于你使用的操作系统和Python解释器版本。 + +\index{help utility 帮助工具} +\end{ex} + + +\begin{ex} +打开Python解释器,我们暂且把它作为计算器。关于数学操作的语法,Python和标准的数学符号很相似。比如,符号{\tt +},{\tt -} 和{\tt /}表示加减,除。乘法的符号是{\tt *}。\\ + +如果43分钟30秒,跑了10公里,每英里花费的时间是多少?你的平均速度是多少英里每小时?(Hint:一英里等于1.61公里)。 + +\index{caculator 计算器} +\index{running pace 跑步速度} +\end{ex} + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thinkpython/tex-zh/part/chapter02.tex b/thinkpython/tex-zh/part/chapter02.tex new file mode 100644 index 0000000..8f80e9e --- /dev/null +++ b/thinkpython/tex-zh/part/chapter02.tex @@ -0,0 +1 @@ +\chapter{变量、表达式和语句} diff --git a/thinkpython/tex-zh/part/chapter03.tex b/thinkpython/tex-zh/part/chapter03.tex new file mode 100644 index 0000000..78fcb03 --- /dev/null +++ b/thinkpython/tex-zh/part/chapter03.tex @@ -0,0 +1 @@ +\chapter{函数} diff --git a/thinkpython/tex-zh/part/chapter04.tex b/thinkpython/tex-zh/part/chapter04.tex new file mode 100644 index 0000000..d9f744b --- /dev/null +++ b/thinkpython/tex-zh/part/chapter04.tex @@ -0,0 +1 @@ +\chapter{实例学习:接口设计} diff --git a/thinkpython/tex-zh/part/chapter05.tex b/thinkpython/tex-zh/part/chapter05.tex new file mode 100644 index 0000000..2c7c0fa --- /dev/null +++ b/thinkpython/tex-zh/part/chapter05.tex @@ -0,0 +1 @@ +\chapter{条件语句和递归} diff --git a/thinkpython/tex-zh/part/chapter06.tex b/thinkpython/tex-zh/part/chapter06.tex new file mode 100644 index 0000000..4857277 --- /dev/null +++ b/thinkpython/tex-zh/part/chapter06.tex @@ -0,0 +1 @@ +\chapter{卓有成效的函数} diff --git a/thinkpython/tex-zh/part/chapter07.tex b/thinkpython/tex-zh/part/chapter07.tex new file mode 100644 index 0000000..eb09a2d --- /dev/null +++ b/thinkpython/tex-zh/part/chapter07.tex @@ -0,0 +1 @@ +\chapter{迭代} diff --git a/thinkpython/tex-zh/part/chapter08.tex b/thinkpython/tex-zh/part/chapter08.tex new file mode 100644 index 0000000..ff1d140 --- /dev/null +++ b/thinkpython/tex-zh/part/chapter08.tex @@ -0,0 +1 @@ +\chapter{字符串} diff --git a/thinkpython/tex-zh/part/chapter09.tex b/thinkpython/tex-zh/part/chapter09.tex new file mode 100644 index 0000000..c87860a --- /dev/null +++ b/thinkpython/tex-zh/part/chapter09.tex @@ -0,0 +1 @@ +\chapter{实例学习:文字处理} diff --git a/thinkpython/tex-zh/part/chapter10.tex b/thinkpython/tex-zh/part/chapter10.tex new file mode 100644 index 0000000..afa4f45 --- /dev/null +++ b/thinkpython/tex-zh/part/chapter10.tex @@ -0,0 +1 @@ +\chapter{列表} diff --git a/thinkpython/tex-zh/part/chapter11.tex b/thinkpython/tex-zh/part/chapter11.tex new file mode 100644 index 0000000..49d13c7 --- /dev/null +++ b/thinkpython/tex-zh/part/chapter11.tex @@ -0,0 +1 @@ +\chapter{字典} diff --git a/thinkpython/tex-zh/part/chapter12.tex b/thinkpython/tex-zh/part/chapter12.tex new file mode 100644 index 0000000..b2f9035 --- /dev/null +++ b/thinkpython/tex-zh/part/chapter12.tex @@ -0,0 +1 @@ +\chapter{元组} diff --git a/thinkpython/tex-zh/part/chapter13.tex b/thinkpython/tex-zh/part/chapter13.tex new file mode 100644 index 0000000..6d3c013 --- /dev/null +++ b/thinkpython/tex-zh/part/chapter13.tex @@ -0,0 +1 @@ +\chapter{实例学习:数据结构的实例} diff --git a/thinkpython/tex-zh/part/chapter14.tex b/thinkpython/tex-zh/part/chapter14.tex new file mode 100644 index 0000000..46ed762 --- /dev/null +++ b/thinkpython/tex-zh/part/chapter14.tex @@ -0,0 +1 @@ +\chapter{文件} diff --git a/thinkpython/tex-zh/part/chapter15.tex b/thinkpython/tex-zh/part/chapter15.tex new file mode 100644 index 0000000..ba5421f --- /dev/null +++ b/thinkpython/tex-zh/part/chapter15.tex @@ -0,0 +1 @@ +\chapter{类和对象} diff --git a/thinkpython/tex-zh/part/chapter16.tex b/thinkpython/tex-zh/part/chapter16.tex new file mode 100644 index 0000000..11738f7 --- /dev/null +++ b/thinkpython/tex-zh/part/chapter16.tex @@ -0,0 +1 @@ +\chapter{类和函数} diff --git a/thinkpython/tex-zh/part/chapter17.tex b/thinkpython/tex-zh/part/chapter17.tex new file mode 100644 index 0000000..c8a452d --- /dev/null +++ b/thinkpython/tex-zh/part/chapter17.tex @@ -0,0 +1 @@ +\chapter{类和方法} diff --git a/thinkpython/tex-zh/part/chapter18.tex b/thinkpython/tex-zh/part/chapter18.tex new file mode 100644 index 0000000..39a2fc0 --- /dev/null +++ b/thinkpython/tex-zh/part/chapter18.tex @@ -0,0 +1 @@ +\chapter{继承} diff --git a/thinkpython/tex-zh/part/chapter19.tex b/thinkpython/tex-zh/part/chapter19.tex new file mode 100644 index 0000000..63ffd1a --- /dev/null +++ b/thinkpython/tex-zh/part/chapter19.tex @@ -0,0 +1 @@ +\chapter{实例学习:Tkinter} diff --git a/thinkpython/tex-zh/part/preamble.tex b/thinkpython/tex-zh/part/preamble.tex new file mode 100644 index 0000000..e69de29 diff --git a/thinkpython/tex/book.aux b/thinkpython/tex/book.aux deleted file mode 100644 index a7c164a..0000000 --- a/thinkpython/tex/book.aux +++ /dev/null @@ -1,363 +0,0 @@ -\relax -\@writefile{toc}{\contentsline {chapter}{Preface}{v}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {chapter}{\numberline {1}The way of the program}{1}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {1.1}The Python programming language}{1}} -\@writefile{toc}{\contentsline {section}{\numberline {1.2}What is a program?}{2}} -\@writefile{toc}{\contentsline {section}{\numberline {1.3}What is debugging?}{3}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.1}Syntax errors}{3}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.2}Runtime errors}{3}} -\newlabel{runtime}{{1.3.2}{3}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.3}Semantic errors}{4}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.4}Experimental debugging}{4}} -\@writefile{toc}{\contentsline {section}{\numberline {1.4}Formal and natural languages}{4}} -\@writefile{toc}{\contentsline {section}{\numberline {1.5}The first program}{6}} -\newlabel{hello}{{1.5}{6}} -\@writefile{toc}{\contentsline {section}{\numberline {1.6}Debugging}{6}} -\@writefile{toc}{\contentsline {section}{\numberline {1.7}Glossary}{7}} -\@writefile{toc}{\contentsline {section}{\numberline {1.8}Exercises}{8}} -\@writefile{toc}{\contentsline {chapter}{\numberline {2}Variables, expressions and statements}{9}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {2.1}Values and types}{9}} -\@writefile{toc}{\contentsline {section}{\numberline {2.2}Variables}{10}} -\@writefile{toc}{\contentsline {section}{\numberline {2.3}Variable names and keywords}{11}} -\@writefile{toc}{\contentsline {section}{\numberline {2.4}Statements}{12}} -\@writefile{toc}{\contentsline {section}{\numberline {2.5}Operators and operands}{12}} -\@writefile{toc}{\contentsline {section}{\numberline {2.6}Expressions}{13}} -\@writefile{toc}{\contentsline {section}{\numberline {2.7}Order of operations}{13}} -\@writefile{toc}{\contentsline {section}{\numberline {2.8}String operations}{14}} -\@writefile{toc}{\contentsline {section}{\numberline {2.9}Comments}{14}} -\@writefile{toc}{\contentsline {section}{\numberline {2.10}Debugging}{15}} -\@writefile{toc}{\contentsline {section}{\numberline {2.11}Glossary}{15}} -\@writefile{toc}{\contentsline {section}{\numberline {2.12}Exercises}{16}} -\@writefile{toc}{\contentsline {chapter}{\numberline {3}Functions}{17}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\newlabel{funcchap}{{3}{17}} -\@writefile{toc}{\contentsline {section}{\numberline {3.1}Function calls}{17}} -\newlabel{functionchap}{{3.1}{17}} -\@writefile{toc}{\contentsline {section}{\numberline {3.2}Type conversion functions}{17}} -\@writefile{toc}{\contentsline {section}{\numberline {3.3}Math functions}{18}} -\@writefile{toc}{\contentsline {section}{\numberline {3.4}Composition}{19}} -\@writefile{toc}{\contentsline {section}{\numberline {3.5}Adding new functions}{19}} -\@writefile{toc}{\contentsline {section}{\numberline {3.6}Definitions and uses}{20}} -\@writefile{toc}{\contentsline {section}{\numberline {3.7}Flow of execution}{21}} -\@writefile{toc}{\contentsline {section}{\numberline {3.8}Parameters and arguments}{21}} -\newlabel{parameters}{{3.8}{21}} -\@writefile{toc}{\contentsline {section}{\numberline {3.9}Variables and parameters are local}{22}} -\@writefile{toc}{\contentsline {section}{\numberline {3.10}Stack diagrams}{23}} -\newlabel{stackdiagram}{{3.10}{23}} -\@writefile{toc}{\contentsline {section}{\numberline {3.11}Fruitful functions and void functions}{24}} -\@writefile{toc}{\contentsline {section}{\numberline {3.12}Why functions?}{25}} -\@writefile{toc}{\contentsline {section}{\numberline {3.13}Debugging}{25}} -\newlabel{editor}{{3.13}{25}} -\@writefile{toc}{\contentsline {section}{\numberline {3.14}Glossary}{25}} -\@writefile{toc}{\contentsline {section}{\numberline {3.15}Exercises}{26}} -\@writefile{toc}{\contentsline {chapter}{\numberline {4}Case study: interface design}{29}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\newlabel{turtlechap}{{4}{29}} -\@writefile{toc}{\contentsline {section}{\numberline {4.1}TurtleWorld}{29}} -\@writefile{toc}{\contentsline {section}{\numberline {4.2}Simple repetition}{30}} -\newlabel{repetition}{{4.2}{30}} -\@writefile{toc}{\contentsline {section}{\numberline {4.3}Exercises}{31}} -\@writefile{toc}{\contentsline {section}{\numberline {4.4}Encapsulation}{32}} -\@writefile{toc}{\contentsline {section}{\numberline {4.5}Generalization}{32}} -\@writefile{toc}{\contentsline {section}{\numberline {4.6}Interface design}{33}} -\@writefile{toc}{\contentsline {section}{\numberline {4.7}Refactoring}{34}} -\newlabel{refactoring}{{4.7}{34}} -\@writefile{toc}{\contentsline {section}{\numberline {4.8}A development plan}{35}} -\@writefile{toc}{\contentsline {section}{\numberline {4.9}docstring}{35}} -\newlabel{docstring}{{4.9}{35}} -\@writefile{toc}{\contentsline {section}{\numberline {4.10}Debugging}{35}} -\@writefile{toc}{\contentsline {section}{\numberline {4.11}Glossary}{36}} -\@writefile{toc}{\contentsline {section}{\numberline {4.12}Exercises}{36}} -\@writefile{toc}{\contentsline {chapter}{\numberline {5}Conditionals and recursion}{39}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {5.1}Modulus operator}{39}} -\@writefile{toc}{\contentsline {section}{\numberline {5.2}Boolean expressions}{39}} -\@writefile{toc}{\contentsline {section}{\numberline {5.3}Logical operators}{40}} -\@writefile{toc}{\contentsline {section}{\numberline {5.4}Conditional execution}{40}} -\newlabel{conditional execution}{{5.4}{40}} -\@writefile{toc}{\contentsline {section}{\numberline {5.5}Alternative execution}{41}} -\newlabel{alternative execution}{{5.5}{41}} -\@writefile{toc}{\contentsline {section}{\numberline {5.6}Chained conditionals}{41}} -\@writefile{toc}{\contentsline {section}{\numberline {5.7}Nested conditionals}{42}} -\@writefile{toc}{\contentsline {section}{\numberline {5.8}Recursion}{42}} -\newlabel{recursion}{{5.8}{42}} -\@writefile{toc}{\contentsline {section}{\numberline {5.9}Stack diagrams for recursive functions}{43}} -\@writefile{toc}{\contentsline {section}{\numberline {5.10}Infinite recursion}{44}} -\@writefile{toc}{\contentsline {section}{\numberline {5.11}Keyboard input}{45}} -\@writefile{toc}{\contentsline {section}{\numberline {5.12}Debugging}{45}} -\newlabel{whitespace}{{5.12}{45}} -\@writefile{toc}{\contentsline {section}{\numberline {5.13}Glossary}{46}} -\@writefile{toc}{\contentsline {section}{\numberline {5.14}Exercises}{47}} -\@writefile{toc}{\contentsline {chapter}{\numberline {6}Fruitful functions}{51}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\newlabel{fruitchap}{{6}{51}} -\@writefile{toc}{\contentsline {section}{\numberline {6.1}Return values}{51}} -\@writefile{toc}{\contentsline {section}{\numberline {6.2}Incremental development}{52}} -\newlabel{incremental development}{{6.2}{52}} -\@writefile{toc}{\contentsline {section}{\numberline {6.3}Composition}{54}} -\@writefile{toc}{\contentsline {section}{\numberline {6.4}Boolean functions}{54}} -\newlabel{boolean}{{6.4}{54}} -\@writefile{toc}{\contentsline {section}{\numberline {6.5}More recursion}{55}} -\@writefile{toc}{\contentsline {section}{\numberline {6.6}Leap of faith}{57}} -\@writefile{toc}{\contentsline {section}{\numberline {6.7}One more example}{57}} -\newlabel{one more example}{{6.7}{57}} -\@writefile{toc}{\contentsline {section}{\numberline {6.8}Checking types}{58}} -\newlabel{guardian}{{6.8}{58}} -\@writefile{toc}{\contentsline {section}{\numberline {6.9}Debugging}{59}} -\newlabel{factdebug}{{6.9}{59}} -\@writefile{toc}{\contentsline {section}{\numberline {6.10}Glossary}{60}} -\@writefile{toc}{\contentsline {section}{\numberline {6.11}Exercises}{60}} -\newlabel{palindrome}{{6.6}{61}} -\@writefile{toc}{\contentsline {chapter}{\numberline {7}Iteration}{63}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {7.1}Multiple assignment}{63}} -\@writefile{toc}{\contentsline {section}{\numberline {7.2}Updating variables}{64}} -\newlabel{update}{{7.2}{64}} -\@writefile{toc}{\contentsline {section}{\numberline {7.3}The {\tt while} statement}{64}} -\@writefile{toc}{\contentsline {section}{\numberline {7.4}{\tt break}}{65}} -\@writefile{toc}{\contentsline {section}{\numberline {7.5}Square roots}{66}} -\newlabel{square_root}{{7.2}{67}} -\@writefile{toc}{\contentsline {section}{\numberline {7.6}Algorithms}{67}} -\@writefile{toc}{\contentsline {section}{\numberline {7.7}Debugging}{68}} -\@writefile{toc}{\contentsline {section}{\numberline {7.8}Glossary}{68}} -\@writefile{toc}{\contentsline {section}{\numberline {7.9}Exercises}{69}} -\@writefile{toc}{\contentsline {chapter}{\numberline {8}Strings}{71}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\newlabel{strings}{{8}{71}} -\@writefile{toc}{\contentsline {section}{\numberline {8.1}A string is a sequence}{71}} -\@writefile{toc}{\contentsline {section}{\numberline {8.2}{\tt len}}{72}} -\@writefile{toc}{\contentsline {section}{\numberline {8.3}Traversal with a {\tt for} loop}{72}} -\newlabel{for}{{8.3}{72}} -\@writefile{toc}{\contentsline {section}{\numberline {8.4}String slices}{73}} -\newlabel{slice}{{8.4}{73}} -\@writefile{toc}{\contentsline {section}{\numberline {8.5}Strings are immutable}{74}} -\@writefile{toc}{\contentsline {section}{\numberline {8.6}Searching}{74}} -\newlabel{find}{{8.6}{74}} -\@writefile{toc}{\contentsline {section}{\numberline {8.7}Looping and counting}{75}} -\newlabel{counter}{{8.7}{75}} -\@writefile{toc}{\contentsline {section}{\numberline {8.8}{\tt string} methods}{75}} -\@writefile{toc}{\contentsline {section}{\numberline {8.9}The {\tt in} operator}{76}} -\newlabel{inboth}{{8.9}{76}} -\@writefile{toc}{\contentsline {section}{\numberline {8.10}String comparison}{77}} -\@writefile{toc}{\contentsline {section}{\numberline {8.11}Debugging}{77}} -\newlabel{is_reverse}{{8.8}{78}} -\@writefile{toc}{\contentsline {section}{\numberline {8.12}Glossary}{79}} -\@writefile{toc}{\contentsline {section}{\numberline {8.13}Exercises}{79}} -\newlabel{exrotate}{{8.12}{80}} -\@writefile{toc}{\contentsline {chapter}{\numberline {9}Case study: word play}{81}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {9.1}Reading word lists}{81}} -\newlabel{wordlist}{{9.1}{81}} -\@writefile{toc}{\contentsline {section}{\numberline {9.2}Exercises}{82}} -\@writefile{toc}{\contentsline {section}{\numberline {9.3}Search}{83}} -\@writefile{toc}{\contentsline {section}{\numberline {9.4}Looping with indices}{84}} -\@writefile{toc}{\contentsline {section}{\numberline {9.5}Debugging}{85}} -\@writefile{toc}{\contentsline {section}{\numberline {9.6}Glossary}{86}} -\@writefile{toc}{\contentsline {section}{\numberline {9.7}Exercises}{86}} -\@writefile{toc}{\contentsline {chapter}{\numberline {10}Lists}{89}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {10.1}A list is a sequence}{89}} -\@writefile{toc}{\contentsline {section}{\numberline {10.2}Lists are mutable}{89}} -\@writefile{toc}{\contentsline {section}{\numberline {10.3}Traversing a list}{91}} -\@writefile{toc}{\contentsline {section}{\numberline {10.4}List operations}{91}} -\@writefile{toc}{\contentsline {section}{\numberline {10.5}List slices}{92}} -\@writefile{toc}{\contentsline {section}{\numberline {10.6}List methods}{92}} -\@writefile{toc}{\contentsline {section}{\numberline {10.7}Map, filter and reduce}{93}} -\newlabel{cumulative}{{10.1}{94}} -\@writefile{toc}{\contentsline {section}{\numberline {10.8}Deleting elements}{94}} -\@writefile{toc}{\contentsline {section}{\numberline {10.9}Lists and strings}{95}} -\@writefile{toc}{\contentsline {section}{\numberline {10.10}Objects and values}{95}} -\@writefile{toc}{\contentsline {section}{\numberline {10.11}Aliasing}{96}} -\@writefile{toc}{\contentsline {section}{\numberline {10.12}List arguments}{97}} -\@writefile{toc}{\contentsline {section}{\numberline {10.13}Debugging}{98}} -\@writefile{toc}{\contentsline {section}{\numberline {10.14}Glossary}{99}} -\@writefile{toc}{\contentsline {section}{\numberline {10.15}Exercises}{100}} -\newlabel{anagram}{{10.4}{100}} -\newlabel{duplicate}{{10.5}{100}} -\newlabel{wordlist1}{{10.8}{101}} -\newlabel{bisection}{{10.8}{101}} -\@writefile{toc}{\contentsline {chapter}{\numberline {11}Dictionaries}{103}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\newlabel{wordlist2}{{11.1}{104}} -\@writefile{toc}{\contentsline {section}{\numberline {11.1}Dictionary as a set of counters}{104}} -\newlabel{histogram}{{11.1}{104}} -\@writefile{toc}{\contentsline {section}{\numberline {11.2}Looping and dictionaries}{106}} -\@writefile{toc}{\contentsline {section}{\numberline {11.3}Reverse lookup}{106}} -\@writefile{toc}{\contentsline {section}{\numberline {11.4}Dictionaries and lists}{107}} -\@writefile{toc}{\contentsline {section}{\numberline {11.5}Memos}{109}} -\@writefile{toc}{\contentsline {section}{\numberline {11.6}Global variables}{110}} -\@writefile{toc}{\contentsline {section}{\numberline {11.7}Long integers}{111}} -\@writefile{toc}{\contentsline {section}{\numberline {11.8}Debugging}{112}} -\@writefile{toc}{\contentsline {section}{\numberline {11.9}Glossary}{112}} -\@writefile{toc}{\contentsline {section}{\numberline {11.10}Exercises}{113}} -\newlabel{exrotatepairs}{{11.9}{113}} -\@writefile{toc}{\contentsline {chapter}{\numberline {12}Tuples}{115}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\newlabel{tuplechap}{{12}{115}} -\@writefile{toc}{\contentsline {section}{\numberline {12.1}Tuples are immutable}{115}} -\@writefile{toc}{\contentsline {section}{\numberline {12.2}Tuple assignment}{116}} -\newlabel{tuple assignment}{{12.2}{116}} -\@writefile{toc}{\contentsline {section}{\numberline {12.3}Tuples as return values}{117}} -\@writefile{toc}{\contentsline {section}{\numberline {12.4}Variable-length argument tuples}{117}} -\@writefile{toc}{\contentsline {section}{\numberline {12.5}Lists and tuples}{118}} -\@writefile{toc}{\contentsline {section}{\numberline {12.6}Dictionaries and tuples}{119}} -\@writefile{toc}{\contentsline {section}{\numberline {12.7}Comparing tuples}{121}} -\newlabel{DSU}{{12.7}{121}} -\@writefile{toc}{\contentsline {section}{\numberline {12.8}Sequences of sequences}{121}} -\@writefile{toc}{\contentsline {section}{\numberline {12.9}Debugging}{122}} -\@writefile{toc}{\contentsline {section}{\numberline {12.10}Glossary}{123}} -\@writefile{toc}{\contentsline {section}{\numberline {12.11}Exercises}{123}} -\newlabel{anagrams}{{12.4}{123}} -\@writefile{toc}{\contentsline {chapter}{\numberline {13}Case study: data structure selection}{125}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {13.1}Word frequency analysis}{125}} -\newlabel{analysis}{{13.1}{125}} -\@writefile{toc}{\contentsline {section}{\numberline {13.2}Random numbers}{126}} -\@writefile{toc}{\contentsline {section}{\numberline {13.3}Word histogram}{127}} -\@writefile{toc}{\contentsline {section}{\numberline {13.4}Most common words}{128}} -\@writefile{toc}{\contentsline {section}{\numberline {13.5}Optional parameters}{128}} -\@writefile{toc}{\contentsline {section}{\numberline {13.6}Dictionary subtraction}{129}} -\@writefile{toc}{\contentsline {section}{\numberline {13.7}Random words}{129}} -\newlabel{randomwords}{{13.7}{129}} -\newlabel{randhist}{{13.7}{130}} -\@writefile{toc}{\contentsline {section}{\numberline {13.8}Markov analysis}{130}} -\@writefile{toc}{\contentsline {section}{\numberline {13.9}Data structures}{131}} -\@writefile{toc}{\contentsline {section}{\numberline {13.10}Debugging}{132}} -\@writefile{toc}{\contentsline {section}{\numberline {13.11}Glossary}{133}} -\@writefile{toc}{\contentsline {section}{\numberline {13.12}Exercises}{134}} -\@writefile{toc}{\contentsline {chapter}{\numberline {14}Files}{135}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {14.1}Persistence}{135}} -\@writefile{toc}{\contentsline {section}{\numberline {14.2}Reading and writing}{135}} -\@writefile{toc}{\contentsline {section}{\numberline {14.3}Format operator}{136}} -\@writefile{toc}{\contentsline {section}{\numberline {14.4}Filenames and paths}{137}} -\newlabel{paths}{{14.4}{137}} -\@writefile{toc}{\contentsline {section}{\numberline {14.5}Catching exceptions}{138}} -\newlabel{catch}{{14.5}{138}} -\@writefile{toc}{\contentsline {section}{\numberline {14.6}Databases}{139}} -\@writefile{toc}{\contentsline {section}{\numberline {14.7}Pickling}{139}} -\@writefile{toc}{\contentsline {section}{\numberline {14.8}Pipes}{140}} -\@writefile{toc}{\contentsline {section}{\numberline {14.9}Writing modules}{141}} -\newlabel{modules}{{14.9}{141}} -\@writefile{toc}{\contentsline {section}{\numberline {14.10}Debugging}{142}} -\@writefile{toc}{\contentsline {section}{\numberline {14.11}Glossary}{143}} -\@writefile{toc}{\contentsline {section}{\numberline {14.12}Exercises}{143}} -\newlabel{urllib}{{14.5}{143}} -\newlabel{checksum}{{14.6}{143}} -\@writefile{toc}{\contentsline {chapter}{\numberline {15}Classes and objects}{145}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {15.1}User-defined types}{145}} -\newlabel{point}{{15.1}{145}} -\@writefile{toc}{\contentsline {section}{\numberline {15.2}Attributes}{146}} -\@writefile{toc}{\contentsline {section}{\numberline {15.3}Rectangles}{147}} -\@writefile{toc}{\contentsline {section}{\numberline {15.4}Instances as return values}{148}} -\@writefile{toc}{\contentsline {section}{\numberline {15.5}Objects are mutable}{148}} -\@writefile{toc}{\contentsline {section}{\numberline {15.6}Copying}{149}} -\@writefile{toc}{\contentsline {section}{\numberline {15.7}Debugging}{150}} -\newlabel{hasattr}{{15.7}{150}} -\@writefile{toc}{\contentsline {section}{\numberline {15.8}Glossary}{151}} -\@writefile{toc}{\contentsline {section}{\numberline {15.9}Exercises}{151}} -\newlabel{canvas}{{15.4}{151}} -\@writefile{toc}{\contentsline {chapter}{\numberline {16}Classes and functions}{153}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\newlabel{time}{{16}{153}} -\@writefile{toc}{\contentsline {section}{\numberline {16.1}Time}{153}} -\newlabel{printtime}{{16.1}{153}} -\newlabel{is_after}{{16.2}{153}} -\@writefile{toc}{\contentsline {section}{\numberline {16.2}Pure functions}{154}} -\@writefile{toc}{\contentsline {section}{\numberline {16.3}Modifiers}{155}} -\newlabel{increment}{{16.3}{155}} -\@writefile{toc}{\contentsline {section}{\numberline {16.4}Prototyping versus planning}{156}} -\newlabel{prototype}{{16.4}{156}} -\@writefile{toc}{\contentsline {section}{\numberline {16.5}Debugging}{157}} -\@writefile{toc}{\contentsline {section}{\numberline {16.6}Glossary}{158}} -\@writefile{toc}{\contentsline {section}{\numberline {16.7}Exercises}{158}} -\@writefile{toc}{\contentsline {chapter}{\numberline {17}Classes and methods}{159}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {17.1}Object-oriented features}{159}} -\@writefile{toc}{\contentsline {section}{\numberline {17.2}Printing objects}{160}} -\newlabel{print_time}{{17.2}{160}} -\newlabel{convert}{{17.1}{161}} -\@writefile{toc}{\contentsline {section}{\numberline {17.3}Another example}{161}} -\@writefile{toc}{\contentsline {section}{\numberline {17.4}A more complicated example}{162}} -\@writefile{toc}{\contentsline {section}{\numberline {17.5}The init method}{162}} -\@writefile{toc}{\contentsline {section}{\numberline {17.6}The {\tt \_\_str\_\_} method}{163}} -\@writefile{toc}{\contentsline {section}{\numberline {17.7}Operator overloading}{163}} -\newlabel{operator overloading}{{17.7}{163}} -\@writefile{toc}{\contentsline {section}{\numberline {17.8}Type-based dispatch}{164}} -\@writefile{toc}{\contentsline {section}{\numberline {17.9}Polymorphism}{165}} -\@writefile{toc}{\contentsline {section}{\numberline {17.10}Debugging}{166}} -\@writefile{toc}{\contentsline {section}{\numberline {17.11}Glossary}{166}} -\@writefile{toc}{\contentsline {section}{\numberline {17.12}Exercises}{167}} -\@writefile{toc}{\contentsline {chapter}{\numberline {18}Inheritance}{169}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {18.1}Card objects}{169}} -\@writefile{toc}{\contentsline {section}{\numberline {18.2}Class attributes}{170}} -\@writefile{toc}{\contentsline {section}{\numberline {18.3}Comparing cards}{171}} -\newlabel{comparecard}{{18.3}{171}} -\@writefile{toc}{\contentsline {section}{\numberline {18.4}Decks}{172}} -\@writefile{toc}{\contentsline {section}{\numberline {18.5}Printing the deck}{172}} -\newlabel{printdeck}{{18.5}{172}} -\@writefile{toc}{\contentsline {section}{\numberline {18.6}Add, remove, shuffle and sort}{173}} -\@writefile{toc}{\contentsline {section}{\numberline {18.7}Inheritance}{174}} -\@writefile{toc}{\contentsline {section}{\numberline {18.8}Class diagrams}{175}} -\@writefile{toc}{\contentsline {section}{\numberline {18.9}Debugging}{176}} -\@writefile{toc}{\contentsline {section}{\numberline {18.10}Glossary}{177}} -\@writefile{toc}{\contentsline {section}{\numberline {18.11}Exercises}{178}} -\@writefile{toc}{\contentsline {chapter}{\numberline {19}Case study: Tkinter}{181}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {19.1}GUI}{181}} -\@writefile{toc}{\contentsline {section}{\numberline {19.2}Buttons and callbacks}{182}} -\@writefile{toc}{\contentsline {section}{\numberline {19.3}Canvas widgets}{183}} -\newlabel{circle}{{19.2}{183}} -\@writefile{toc}{\contentsline {section}{\numberline {19.4}Coordinate sequences}{184}} -\@writefile{toc}{\contentsline {section}{\numberline {19.5}More widgets}{184}} -\newlabel{circle2}{{19.3}{185}} -\@writefile{toc}{\contentsline {section}{\numberline {19.6}Packing widgets}{185}} -\@writefile{toc}{\contentsline {section}{\numberline {19.7}Menus and Callables}{188}} -\@writefile{toc}{\contentsline {section}{\numberline {19.8}Binding}{189}} -\@writefile{toc}{\contentsline {section}{\numberline {19.9}Debugging}{191}} -\@writefile{toc}{\contentsline {section}{\numberline {19.10}Glossary}{191}} -\@writefile{toc}{\contentsline {section}{\numberline {19.11}Exercises}{192}} -\@writefile{toc}{\contentsline {chapter}{\numberline {A}Debugging}{195}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {A.1}Syntax errors}{195}} -\@writefile{toc}{\contentsline {subsection}{\numberline {A.1.1}I keep making changes and it makes no difference.}{196}} -\@writefile{toc}{\contentsline {section}{\numberline {A.2}Runtime errors}{197}} -\@writefile{toc}{\contentsline {subsection}{\numberline {A.2.1}My program does absolutely nothing.}{197}} -\@writefile{toc}{\contentsline {subsection}{\numberline {A.2.2}My program hangs.}{197}} -\@writefile{toc}{\contentsline {subsubsection}{Infinite Loop}{197}} -\@writefile{toc}{\contentsline {subsubsection}{Infinite Recursion}{198}} -\@writefile{toc}{\contentsline {subsubsection}{Flow of Execution}{198}} -\@writefile{toc}{\contentsline {subsection}{\numberline {A.2.3}When I run the program I get an exception.}{198}} -\@writefile{toc}{\contentsline {subsection}{\numberline {A.2.4}I added so many {\tt print} statements I get inundated with output.}{199}} -\@writefile{toc}{\contentsline {section}{\numberline {A.3}Semantic errors}{199}} -\@writefile{toc}{\contentsline {subsection}{\numberline {A.3.1}My program doesn't work.}{200}} -\@writefile{toc}{\contentsline {subsection}{\numberline {A.3.2}I've got a big hairy expression and it doesn't do what I expect.}{200}} -\@writefile{toc}{\contentsline {subsection}{\numberline {A.3.3}I've got a function or method that doesn't return what I expect.}{201}} -\@writefile{toc}{\contentsline {subsection}{\numberline {A.3.4}I'm really, really stuck and I need help.}{201}} -\@writefile{toc}{\contentsline {subsection}{\numberline {A.3.5}No, I really need help.}{202}} diff --git a/thinkpython/tex/book.dvi b/thinkpython/tex/book.dvi deleted file mode 100644 index f1f668f..0000000 Binary files a/thinkpython/tex/book.dvi and /dev/null differ diff --git a/thinkpython/tex/book.idx b/thinkpython/tex/book.idx deleted file mode 100644 index 5729e58..0000000 --- a/thinkpython/tex/book.idx +++ /dev/null @@ -1,1860 +0,0 @@ -\indexentry{GNU Free Documentation License}{v} -\indexentry{Free Documentation License, GNU}{v} -\indexentry{GNU Free Documentation License}{vi} -\indexentry{Free Documentation License, GNU}{vi} -\indexentry{contributors}{vii} -\indexentry{problem solving}{1} -\indexentry{programming language}{1} -\indexentry{language!programming}{1} -\indexentry{portability}{1} -\indexentry{high-level language}{1} -\indexentry{low-level language}{1} -\indexentry{language!high-level}{1} -\indexentry{language!low-level}{1} -\indexentry{compile}{1} -\indexentry{interpret}{1} -\indexentry{source code}{2} -\indexentry{object code}{2} -\indexentry{executable}{2} -\indexentry{interactive mode}{2} -\indexentry{script mode}{2} -\indexentry{prompt}{2} -\indexentry{script}{2} -\indexentry{testing!interactive mode}{2} -\indexentry{program}{2} -\indexentry{algorithm}{3} -\indexentry{debugging}{3} -\indexentry{bug}{3} -\indexentry{debugging}{3} -\indexentry{bug}{3} -\indexentry{syntax error}{3} -\indexentry{error!syntax}{3} -\indexentry{error message}{3} -\indexentry{syntax}{3} -\indexentry{parentheses!matching}{3} -\indexentry{syntax}{3} -\indexentry{cummings, e. e.}{3} -\indexentry{runtime error}{3} -\indexentry{error!runtime}{3} -\indexentry{exception}{3} -\indexentry{safe language}{3} -\indexentry{language!safe}{3} -\indexentry{semantics}{4} -\indexentry{semantic error}{4} -\indexentry{error!semantic}{4} -\indexentry{error message}{4} -\indexentry{experimental debugging}{4} -\indexentry{debugging!experimental}{4} -\indexentry{Holmes, Sherlock}{4} -\indexentry{Doyle, Arthur Conan}{4} -\indexentry{Linux}{4} -\indexentry{formal language}{4} -\indexentry{natural language}{4} -\indexentry{language!formal}{4} -\indexentry{language!natural}{4} -\indexentry{token}{5} -\indexentry{structure}{5} -\indexentry{parse}{5} -\indexentry{ambiguity}{5} -\indexentry{redundancy}{5} -\indexentry{literalness}{5} -\indexentry{poetry}{5} -\indexentry{prose}{5} -\indexentry{Hello, World}{6} -\indexentry{Python 3.0}{6} -\indexentry{quotation mark}{6} -\indexentry{print statement}{6} -\indexentry{statement!print}{6} -\indexentry{debugging}{6} -\indexentry{error message}{6} -\indexentry{debugging!emotional response}{6} -\indexentry{emotional debugging}{6} -\indexentry{problem solving}{7} -\indexentry{high-level language}{7} -\indexentry{low-level language}{7} -\indexentry{portability}{7} -\indexentry{interpret}{7} -\indexentry{compile}{7} -\indexentry{source code}{7} -\indexentry{object code}{7} -\indexentry{executable}{7} -\indexentry{prompt}{7} -\indexentry{script}{7} -\indexentry{interactive mode}{7} -\indexentry{script mode}{7} -\indexentry{program}{7} -\indexentry{algorithm}{7} -\indexentry{bug}{7} -\indexentry{debugging}{7} -\indexentry{syntax}{7} -\indexentry{syntax error}{7} -\indexentry{exception}{7} -\indexentry{semantics}{8} -\indexentry{semantic error}{8} -\indexentry{natural language}{8} -\indexentry{formal language}{8} -\indexentry{token}{8} -\indexentry{parse}{8} -\indexentry{print statement}{8} -\indexentry{statement!print}{8} -\indexentry{documentation}{8} -\indexentry{python.org}{8} -\indexentry{help utility}{8} -\indexentry{calculator}{8} -\indexentry{running pace}{8} -\indexentry{value}{9} -\indexentry{type}{9} -\indexentry{string}{9} -\indexentry{quotation mark}{9} -\indexentry{type}{9} -\indexentry{string type}{9} -\indexentry{type!str}{9} -\indexentry{int type}{9} -\indexentry{type!int}{9} -\indexentry{float type}{9} -\indexentry{type!float}{9} -\indexentry{quotation mark}{9} -\indexentry{semantic error}{10} -\indexentry{error!semantic}{10} -\indexentry{error message}{10} -\indexentry{variable}{10} -\indexentry{assignment statement}{10} -\indexentry{statement!assignment}{10} -\indexentry{state diagram}{10} -\indexentry{diagram!state}{10} -\indexentry{octal}{11} -\indexentry{keyword}{11} -\indexentry{underscore character}{11} -\indexentry{keyword}{11} -\indexentry{statement}{12} -\indexentry{interactive mode}{12} -\indexentry{script mode}{12} -\indexentry{operator, arithmetic}{12} -\indexentry{arithmetic operator}{12} -\indexentry{operand}{12} -\indexentry{expression}{12} -\indexentry{bitwise operator}{12} -\indexentry{operator!bitwise}{12} -\indexentry{Python 3.0}{12} -\indexentry{floor division}{12} -\indexentry{floating-point division}{12} -\indexentry{division!floor}{12} -\indexentry{division!floating-point}{12} -\indexentry{expression}{13} -\indexentry{evaluate}{13} -\indexentry{order of operations}{13} -\indexentry{rules of precedence}{13} -\indexentry{PEMDAS}{13} -\indexentry{parentheses!overriding precedence}{13} -\indexentry{string!operation}{14} -\indexentry{operator!string}{14} -\indexentry{concatenation}{14} -\indexentry{commutativity}{14} -\indexentry{comment}{14} -\indexentry{debugging}{15} -\indexentry{syntax error}{15} -\indexentry{error!syntax}{15} -\indexentry{error message}{15} -\indexentry{use before def}{15} -\indexentry{exception}{15} -\indexentry{runtime error}{15} -\indexentry{error!runtime}{15} -\indexentry{case-sensitivity, variable names}{15} -\indexentry{semantic error}{15} -\indexentry{error!semantic}{15} -\indexentry{order of operations}{15} -\indexentry{value}{15} -\indexentry{type}{15} -\indexentry{integer}{15} -\indexentry{floating-point}{15} -\indexentry{string}{15} -\indexentry{variable}{15} -\indexentry{statement}{15} -\indexentry{assignment}{15} -\indexentry{state diagram}{15} -\indexentry{keyword}{15} -\indexentry{operator}{16} -\indexentry{operand}{16} -\indexentry{floor division}{16} -\indexentry{expression}{16} -\indexentry{rules of precedence}{16} -\indexentry{precedence}{16} -\indexentry{concatenation}{16} -\indexentry{comment}{16} -\indexentry{calculator}{16} -\indexentry{running pace}{16} -\indexentry{function call}{17} -\indexentry{parentheses!argument in}{17} -\indexentry{argument}{17} -\indexentry{return value}{17} -\indexentry{conversion!type}{17} -\indexentry{type conversion}{17} -\indexentry{int function}{17} -\indexentry{function!int}{17} -\indexentry{float function}{17} -\indexentry{function!float}{17} -\indexentry{str function}{18} -\indexentry{function!str}{18} -\indexentry{math function}{18} -\indexentry{function, math}{18} -\indexentry{module}{18} -\indexentry{module object}{18} -\indexentry{dot notation}{18} -\indexentry{log function}{18} -\indexentry{function!log}{18} -\indexentry{sine function}{18} -\indexentry{radian}{18} -\indexentry{trigonometric function}{18} -\indexentry{function, trigonometric}{18} -\indexentry{pi}{18} -\indexentry{sqrt function}{18} -\indexentry{function!sqrt}{18} -\indexentry{composition}{19} -\indexentry{SyntaxError}{19} -\indexentry{exception!SyntaxError}{19} -\indexentry{function}{19} -\indexentry{function definition}{19} -\indexentry{definition!function}{19} -\indexentry{def keyword}{19} -\indexentry{keyword!def}{19} -\indexentry{argument}{19} -\indexentry{parentheses!empty}{19} -\indexentry{header}{19} -\indexentry{body}{19} -\indexentry{indentation}{19} -\indexentry{colon}{19} -\indexentry{ellipses}{20} -\indexentry{function object}{20} -\indexentry{object!function}{20} -\indexentry{function definition}{20} -\indexentry{use before def}{21} -\indexentry{flow of execution}{21} -\indexentry{parameter}{21} -\indexentry{function parameter}{21} -\indexentry{argument}{21} -\indexentry{function argument}{21} -\indexentry{parentheses!parameters in}{22} -\indexentry{composition}{22} -\indexentry{argument}{22} -\indexentry{local variable}{22} -\indexentry{variable!local}{22} -\indexentry{parentheses!parameters in}{22} -\indexentry{concatenation}{23} -\indexentry{NameError}{23} -\indexentry{exception!NameError}{23} -\indexentry{parameter}{23} -\indexentry{stack diagram}{23} -\indexentry{function frame}{23} -\indexentry{frame}{23} -\indexentry{stack diagram}{23} -\indexentry{diagram!stack}{23} -\indexentry{traceback}{24} -\indexentry{fruitful function}{24} -\indexentry{void function}{24} -\indexentry{function, fruitful}{24} -\indexentry{function, void}{24} -\indexentry{interactive mode}{24} -\indexentry{script mode}{24} -\indexentry{None special value}{24} -\indexentry{special value!None}{24} -\indexentry{function, reasons for}{25} -\indexentry{debugging}{25} -\indexentry{whitespace}{25} -\indexentry{function}{25} -\indexentry{function definition}{25} -\indexentry{function definition}{25} -\indexentry{header}{25} -\indexentry{body}{25} -\indexentry{parameter}{25} -\indexentry{function call}{26} -\indexentry{argument}{26} -\indexentry{local variable}{26} -\indexentry{return value}{26} -\indexentry{fruitful function}{26} -\indexentry{void function}{26} -\indexentry{module}{26} -\indexentry{import statement}{26} -\indexentry{statement!import}{26} -\indexentry{module}{26} -\indexentry{dot notation}{26} -\indexentry{composition}{26} -\indexentry{flow of execution}{26} -\indexentry{stack diagram}{26} -\indexentry{function frame}{26} -\indexentry{frame}{26} -\indexentry{traceback}{26} -\indexentry{len function}{26} -\indexentry{function!len}{26} -\indexentry{function object}{26} -\indexentry{object!function}{26} -\indexentry{grid}{27} -\indexentry{TurtleWorld}{29} -\indexentry{Swampy}{29} -\indexentry{import statement}{29} -\indexentry{statement!import}{29} -\indexentry{instance}{29} -\indexentry{repetition}{30} -\indexentry{for loop}{30} -\indexentry{loop!for}{30} -\indexentry{statement!for}{30} -\indexentry{loop}{31} -\indexentry{polygon function}{31} -\indexentry{function!polygon}{31} -\indexentry{circle function}{31} -\indexentry{function!circle}{31} -\indexentry{arc function}{31} -\indexentry{function!arc}{31} -\indexentry{encapsulation}{32} -\indexentry{generalization}{32} -\indexentry{keyword argument}{33} -\indexentry{argument!keyword}{33} -\indexentry{interface}{33} -\indexentry{Einstein, Albert}{33} -\indexentry{refactoring}{34} -\indexentry{refactoring}{34} -\indexentry{development plan!encapsulation and generalization}{35} -\indexentry{docstring}{35} -\indexentry{quotation mark}{35} -\indexentry{triple-quoted string}{35} -\indexentry{string!triple-quoted}{35} -\indexentry{multiline string}{35} -\indexentry{string!multiline}{35} -\indexentry{debugging}{35} -\indexentry{interface}{35} -\indexentry{precondition}{36} -\indexentry{postcondition}{36} -\indexentry{instance}{36} -\indexentry{loop}{36} -\indexentry{encapsulation}{36} -\indexentry{generalization}{36} -\indexentry{keyword argument}{36} -\indexentry{argument!keyword}{36} -\indexentry{interface}{36} -\indexentry{development plan}{36} -\indexentry{docstring}{36} -\indexentry{precondition}{36} -\indexentry{precondition}{36} -\indexentry{stack diagram}{36} -\indexentry{flower}{37} -\indexentry{pie}{37} -\indexentry{alphabet}{37} -\indexentry{turtle typewriter}{37} -\indexentry{typewriter, turtle}{37} -\indexentry{modulus operator}{39} -\indexentry{operator!modulus}{39} -\indexentry{divisibility}{39} -\indexentry{boolean expression}{39} -\indexentry{expression!boolean}{39} -\indexentry{logical operator}{39} -\indexentry{operator!logical}{39} -\indexentry{True special value}{39} -\indexentry{False special value}{39} -\indexentry{special value!True}{39} -\indexentry{special value!False}{39} -\indexentry{bool type}{39} -\indexentry{type!bool}{39} -\indexentry{relational operator}{40} -\indexentry{operator!relational}{40} -\indexentry{logical operator}{40} -\indexentry{operator!logical}{40} -\indexentry{and operator}{40} -\indexentry{or operator}{40} -\indexentry{not operator}{40} -\indexentry{operator!and}{40} -\indexentry{operator!or}{40} -\indexentry{operator!not}{40} -\indexentry{conditional statement}{40} -\indexentry{statement!conditional}{40} -\indexentry{if statement}{40} -\indexentry{statement!if}{40} -\indexentry{conditional execution}{40} -\indexentry{condition}{40} -\indexentry{compound statement}{40} -\indexentry{statement!compound}{40} -\indexentry{pass statement}{41} -\indexentry{statement!pass}{41} -\indexentry{alternative execution}{41} -\indexentry{else keyword}{41} -\indexentry{keyword!else}{41} -\indexentry{branch}{41} -\indexentry{chained conditional}{41} -\indexentry{conditional!chained}{41} -\indexentry{elif keyword}{41} -\indexentry{keyword!elif}{41} -\indexentry{nested conditional}{42} -\indexentry{conditional!nested}{42} -\indexentry{recursion}{42} -\indexentry{recursion}{43} -\indexentry{function!recursive}{43} -\indexentry{return statement}{43} -\indexentry{statement!return}{43} -\indexentry{stack diagram}{43} -\indexentry{function frame}{43} -\indexentry{frame}{43} -\indexentry{base case}{44} -\indexentry{recursion!base case}{44} -\indexentry{infinite recursion}{44} -\indexentry{recursion!infinite}{44} -\indexentry{runtime error}{44} -\indexentry{error!runtime}{44} -\indexentry{traceback}{44} -\indexentry{exception!RuntimeError}{44} -\indexentry{RuntimeError}{44} -\indexentry{keyboard input}{45} -\indexentry{Python 3.0}{45} -\indexentry{raw\_input function}{45} -\indexentry{function!raw\_input}{45} -\indexentry{prompt}{45} -\indexentry{newline}{45} -\indexentry{ValueError}{45} -\indexentry{exception!ValueError}{45} -\indexentry{debugging}{45} -\indexentry{traceback}{45} -\indexentry{whitespace}{46} -\indexentry{error!runtime}{46} -\indexentry{runtime error}{46} -\indexentry{exception!OverflowError}{46} -\indexentry{OverflowError}{46} -\indexentry{floor division}{46} -\indexentry{division!floor}{46} -\indexentry{modulus operator}{46} -\indexentry{operator!modulus}{46} -\indexentry{boolean expression}{46} -\indexentry{expression!boolean}{46} -\indexentry{conditional statement}{47} -\indexentry{statement!conditional}{47} -\indexentry{condition}{47} -\indexentry{compound statement}{47} -\indexentry{body}{47} -\indexentry{branch}{47} -\indexentry{chained conditional}{47} -\indexentry{conditional!chained}{47} -\indexentry{nested conditional}{47} -\indexentry{conditional!nested}{47} -\indexentry{recursion}{47} -\indexentry{base case}{47} -\indexentry{infinite recursion}{47} -\indexentry{Fermat's Last Theorem}{47} -\indexentry{triangle}{47} -\indexentry{TurtleWorld}{48} -\indexentry{Koch curve}{48} -\indexentry{return value}{51} -\indexentry{return statement}{51} -\indexentry{statement!return}{51} -\indexentry{temporary variable}{51} -\indexentry{variable!temporary}{51} -\indexentry{dead code}{52} -\indexentry{None special value}{52} -\indexentry{special value!None}{52} -\indexentry{abs function}{52} -\indexentry{function!abs}{52} -\indexentry{compare function}{52} -\indexentry{function!compare}{52} -\indexentry{development plan!incremental}{52} -\indexentry{testing!incremental development}{52} -\indexentry{Pythagorean theorem}{52} -\indexentry{testing!knowing the answer}{53} -\indexentry{sqrt}{53} -\indexentry{function!sqrt}{53} -\indexentry{scaffolding}{53} -\indexentry{hypotenuse}{54} -\indexentry{composition}{54} -\indexentry{function composition}{54} -\indexentry{encapsulation}{54} -\indexentry{boolean function}{54} -\indexentry{conditional statement}{55} -\indexentry{statement!conditional}{55} -\indexentry{recursion}{55} -\indexentry{Turing complete language}{55} -\indexentry{language!Turing complete}{55} -\indexentry{Turing, Alan}{55} -\indexentry{Turing Thesis}{55} -\indexentry{frabjous}{56} -\indexentry{circular definition}{56} -\indexentry{definition!circular}{56} -\indexentry{factorial function}{56} -\indexentry{function!factorial}{56} -\indexentry{recursive definition}{56} -\indexentry{stack diagram}{56} -\indexentry{frame}{57} -\indexentry{recursion}{57} -\indexentry{leap of faith}{57} -\indexentry{testing!leap of faith}{57} -\indexentry{fibonacci function}{57} -\indexentry{function!fibonacci}{57} -\indexentry{flow of execution}{58} -\indexentry{type checking}{58} -\indexentry{error checking}{58} -\indexentry{factorial function}{58} -\indexentry{RuntimeError}{58} -\indexentry{infinite recursion}{58} -\indexentry{recursion!infinite}{58} -\indexentry{gamma function}{58} -\indexentry{isinstance function}{58} -\indexentry{function!isinstance}{58} -\indexentry{guardian pattern}{59} -\indexentry{pattern!guardian}{59} -\indexentry{debugging}{59} -\indexentry{precondition}{59} -\indexentry{postcondition}{59} -\indexentry{flow of execution}{59} -\indexentry{temporary variable}{60} -\indexentry{variable!temporary}{60} -\indexentry{dead code}{60} -\indexentry{None special value}{60} -\indexentry{special value!None}{60} -\indexentry{incremental development}{60} -\indexentry{scaffolding}{60} -\indexentry{guardian pattern}{60} -\indexentry{pattern!guardian}{60} -\indexentry{stack diagram}{60} -\indexentry{Ackerman function}{61} -\indexentry{function!ack}{61} -\indexentry{palindrome}{61} -\indexentry{greatest common divisor (GCD)}{61} -\indexentry{GCD (greatest common divisor)}{61} -\indexentry{Euclid's algorithm}{62} -\indexentry{algorithm!Euclid}{62} -\indexentry{iteration}{63} -\indexentry{assignment}{63} -\indexentry{statement!assignment}{63} -\indexentry{multiple assignment}{63} -\indexentry{newline}{63} -\indexentry{state diagram}{63} -\indexentry{diagram!state}{63} -\indexentry{equality and assignment}{63} -\indexentry{update}{64} -\indexentry{variable!updating}{64} -\indexentry{initialization (before update)}{64} -\indexentry{increment}{64} -\indexentry{decrement}{64} -\indexentry{statement!while}{64} -\indexentry{while loop}{64} -\indexentry{loop!while}{64} -\indexentry{iteration}{64} -\indexentry{flow of execution}{64} -\indexentry{condition}{65} -\indexentry{loop}{65} -\indexentry{body}{65} -\indexentry{infinite loop}{65} -\indexentry{loop!infinite}{65} -\indexentry{Collatz conjecture}{65} -\indexentry{break statement}{65} -\indexentry{statement!break}{65} -\indexentry{square root}{66} -\indexentry{Newton's method}{66} -\indexentry{update}{66} -\indexentry{floating-point}{67} -\indexentry{epsilon}{67} -\indexentry{encapsulation}{67} -\indexentry{algorithm}{67} -\indexentry{addition with carrying}{68} -\indexentry{carrying, addition with}{68} -\indexentry{subtraction!with borrowing}{68} -\indexentry{borrowing, subtraction with}{68} -\indexentry{debugging!by bisection}{68} -\indexentry{bisection, debugging by}{68} -\indexentry{multiple assignment}{68} -\indexentry{assignment!multiple}{68} -\indexentry{update}{68} -\indexentry{initialization!variable}{68} -\indexentry{increment}{68} -\indexentry{decrement}{69} -\indexentry{iteration}{69} -\indexentry{infinite loop}{69} -\indexentry{algorithm!square root}{69} -\indexentry{eval function}{69} -\indexentry{function!eval}{69} -\indexentry{Ramanujan, Srinivasa}{69} -\indexentry{pi}{69} -\indexentry{sequence}{71} -\indexentry{character}{71} -\indexentry{bracket operator}{71} -\indexentry{operator!bracket}{71} -\indexentry{index}{71} -\indexentry{index!starting at zero}{71} -\indexentry{zero, index starting at}{71} -\indexentry{index}{71} -\indexentry{exception!TypeError}{71} -\indexentry{TypeError}{71} -\indexentry{len function}{72} -\indexentry{function!len}{72} -\indexentry{exception!IndexError}{72} -\indexentry{IndexError}{72} -\indexentry{index!negative}{72} -\indexentry{negative index}{72} -\indexentry{traversal}{72} -\indexentry{loop!traversal}{72} -\indexentry{for loop}{72} -\indexentry{loop!for}{72} -\indexentry{statement!for}{72} -\indexentry{traversal}{72} -\indexentry{concatenation}{72} -\indexentry{abecedarian}{72} -\indexentry{McCloskey, Robert}{72} -\indexentry{slice operator}{73} -\indexentry{operator!slice}{73} -\indexentry{index!slice}{73} -\indexentry{string!slice}{73} -\indexentry{slice!string}{73} -\indexentry{quotation mark}{74} -\indexentry{copy!slice}{74} -\indexentry{slice!copy}{74} -\indexentry{mutability}{74} -\indexentry{immutability}{74} -\indexentry{string!immutable}{74} -\indexentry{TypeError}{74} -\indexentry{exception!TypeError}{74} -\indexentry{object}{74} -\indexentry{item assignment}{74} -\indexentry{assignment!item}{74} -\indexentry{immutability}{74} -\indexentry{concatenation}{74} -\indexentry{find function}{74} -\indexentry{function!find}{74} -\indexentry{traversal}{75} -\indexentry{search pattern}{75} -\indexentry{pattern!search}{75} -\indexentry{counter}{75} -\indexentry{counting and looping}{75} -\indexentry{looping and counting}{75} -\indexentry{looping!with strings}{75} -\indexentry{encapsulation}{75} -\indexentry{method}{75} -\indexentry{string!method}{75} -\indexentry{dot notation}{75} -\indexentry{parentheses!empty}{75} -\indexentry{invocation}{75} -\indexentry{optional argument}{76} -\indexentry{argument!optional}{76} -\indexentry{count method}{76} -\indexentry{method!count}{76} -\indexentry{in operator}{76} -\indexentry{operator!in}{76} -\indexentry{boolean operator}{76} -\indexentry{operator!boolean}{76} -\indexentry{string!comparison}{77} -\indexentry{comparison!string}{77} -\indexentry{debugging}{77} -\indexentry{traversal}{77} -\indexentry{guardian pattern}{77} -\indexentry{pattern!guardian}{77} -\indexentry{index}{77} -\indexentry{IndexError}{78} -\indexentry{exception!IndexError}{78} -\indexentry{semantic error}{78} -\indexentry{error!semantic}{78} -\indexentry{state diagram}{78} -\indexentry{diagram!state}{78} -\indexentry{object}{79} -\indexentry{sequence}{79} -\indexentry{item}{79} -\indexentry{index}{79} -\indexentry{slice}{79} -\indexentry{empty string}{79} -\indexentry{immutability}{79} -\indexentry{traversal}{79} -\indexentry{search pattern}{79} -\indexentry{pattern!search}{79} -\indexentry{counter}{79} -\indexentry{method}{79} -\indexentry{invocation}{79} -\indexentry{step size}{79} -\indexentry{slice operator}{79} -\indexentry{operator!slice}{79} -\indexentry{palindrome}{79} -\indexentry{string method}{79} -\indexentry{method!string}{79} -\indexentry{letter rotation}{80} -\indexentry{rotation, letter}{80} -\indexentry{Swampy}{81} -\indexentry{crosswords}{81} -\indexentry{open function}{81} -\indexentry{function!open}{81} -\indexentry{plain text}{81} -\indexentry{text!plain}{81} -\indexentry{object!file}{81} -\indexentry{file object}{81} -\indexentry{readline method}{81} -\indexentry{method!readline}{81} -\indexentry{strip method}{82} -\indexentry{method!strip}{82} -\indexentry{open function}{82} -\indexentry{function!open}{82} -\indexentry{whitespace}{82} -\indexentry{lipogram}{82} -\indexentry{abecedarian}{83} -\indexentry{search pattern}{83} -\indexentry{pattern!search}{83} -\indexentry{traversal}{83} -\indexentry{generalization}{83} -\indexentry{traversal}{83} -\indexentry{problem recognition}{84} -\indexentry{development plan!problem recognition}{84} -\indexentry{looping!with indices}{84} -\indexentry{index!looping with}{84} -\indexentry{palindrome}{84} -\indexentry{problem recognition}{85} -\indexentry{development plan!problem recognition}{85} -\indexentry{debugging}{85} -\indexentry{testing!is hard}{85} -\indexentry{program testing}{85} -\indexentry{special case}{85} -\indexentry{testing!and absence of bugs}{85} -\indexentry{Dijkstra, Edsger}{85} -\indexentry{file object}{86} -\indexentry{object!file}{86} -\indexentry{problem recognition}{86} -\indexentry{special case}{86} -\indexentry{Car Talk}{86} -\indexentry{Puzzler}{86} -\indexentry{double letters}{86} -\indexentry{Car Talk}{86} -\indexentry{Puzzler}{86} -\indexentry{odometer}{86} -\indexentry{palindrome}{86} -\indexentry{Car Talk}{86} -\indexentry{Puzzler}{86} -\indexentry{palindrome}{86} -\indexentry{list}{89} -\indexentry{type!list}{89} -\indexentry{element}{89} -\indexentry{sequence}{89} -\indexentry{item}{89} -\indexentry{nested list}{89} -\indexentry{list!nested}{89} -\indexentry{empty list}{89} -\indexentry{list!empty}{89} -\indexentry{assignment}{89} -\indexentry{list!element}{89} -\indexentry{access}{89} -\indexentry{index}{89} -\indexentry{bracket operator}{89} -\indexentry{operator!bracket}{89} -\indexentry{mutability}{90} -\indexentry{index!starting at zero}{90} -\indexentry{zero, index starting at}{90} -\indexentry{state diagram}{90} -\indexentry{diagram!state}{90} -\indexentry{mapping}{90} -\indexentry{item assignment}{90} -\indexentry{assignment!item}{90} -\indexentry{exception!IndexError}{90} -\indexentry{IndexError}{90} -\indexentry{list!index}{90} -\indexentry{list!membership}{90} -\indexentry{membership!list}{90} -\indexentry{in operator}{90} -\indexentry{operator!in}{90} -\indexentry{list!traversal}{91} -\indexentry{traversal!list}{91} -\indexentry{for loop}{91} -\indexentry{loop!for}{91} -\indexentry{statement!for}{91} -\indexentry{looping!with indices}{91} -\indexentry{index!looping with}{91} -\indexentry{item update}{91} -\indexentry{update!item}{91} -\indexentry{nested list}{91} -\indexentry{list!nested}{91} -\indexentry{list!operation}{91} -\indexentry{concatenation!list}{91} -\indexentry{list!concatenation}{91} -\indexentry{repetition!list}{91} -\indexentry{list!repetition}{91} -\indexentry{slice operator}{92} -\indexentry{operator!slice}{92} -\indexentry{index!slice}{92} -\indexentry{list!slice}{92} -\indexentry{slice!list}{92} -\indexentry{list!copy}{92} -\indexentry{slice!copy}{92} -\indexentry{copy!slice}{92} -\indexentry{mutability}{92} -\indexentry{slice!update}{92} -\indexentry{update!slice}{92} -\indexentry{list!method}{92} -\indexentry{method, list}{92} -\indexentry{append method}{92} -\indexentry{method!append}{92} -\indexentry{extend method}{92} -\indexentry{method!extend}{92} -\indexentry{sort method}{92} -\indexentry{method!sort}{92} -\indexentry{void method}{93} -\indexentry{method!void}{93} -\indexentry{None special value}{93} -\indexentry{special value!None}{93} -\indexentry{update operator}{93} -\indexentry{operator!update}{93} -\indexentry{assignment!augmented}{93} -\indexentry{augmented assignment}{93} -\indexentry{accumulator!sum}{93} -\indexentry{reduce pattern}{93} -\indexentry{pattern!reduce}{93} -\indexentry{traversal}{93} -\indexentry{accumulator!list}{93} -\indexentry{map pattern}{93} -\indexentry{pattern!map}{93} -\indexentry{filter pattern}{93} -\indexentry{pattern!filter}{93} -\indexentry{list!comprehension}{94} -\indexentry{cumulative sum}{94} -\indexentry{element deletion}{94} -\indexentry{deletion, element of list}{94} -\indexentry{pop method}{94} -\indexentry{method!pop}{94} -\indexentry{del operator}{94} -\indexentry{operator!del}{94} -\indexentry{remove method}{94} -\indexentry{method!remove}{94} -\indexentry{None special value}{94} -\indexentry{special value!None}{94} -\indexentry{list}{95} -\indexentry{string}{95} -\indexentry{sequence}{95} -\indexentry{list!function}{95} -\indexentry{function!list}{95} -\indexentry{split method}{95} -\indexentry{method!split}{95} -\indexentry{optional argument}{95} -\indexentry{argument!optional}{95} -\indexentry{delimiter}{95} -\indexentry{join method}{95} -\indexentry{method!join}{95} -\indexentry{concatenation}{95} -\indexentry{empty string}{95} -\indexentry{string!empty}{95} -\indexentry{object}{95} -\indexentry{value}{95} -\indexentry{aliasing}{96} -\indexentry{is operator}{96} -\indexentry{operator!is}{96} -\indexentry{state diagram}{96} -\indexentry{diagram!state}{96} -\indexentry{equivalence}{96} -\indexentry{identity}{96} -\indexentry{object}{96} -\indexentry{value}{96} -\indexentry{aliasing}{96} -\indexentry{reference!aliasing}{96} -\indexentry{state diagram}{97} -\indexentry{diagram!state}{97} -\indexentry{reference}{97} -\indexentry{mutability}{97} -\indexentry{immutability}{97} -\indexentry{list!as argument}{97} -\indexentry{argument}{97} -\indexentry{argument!list}{97} -\indexentry{reference}{97} -\indexentry{parameter}{97} -\indexentry{stack diagram}{97} -\indexentry{diagram!stack}{97} -\indexentry{append method}{98} -\indexentry{method!append}{98} -\indexentry{list!concatenation}{98} -\indexentry{concatenation!list}{98} -\indexentry{slice operator}{98} -\indexentry{operator!slice}{98} -\indexentry{debugging}{98} -\indexentry{sort method}{99} -\indexentry{method!sort}{99} -\indexentry{aliasing!copying to avoid}{99} -\indexentry{copy!to avoid aliasing}{99} -\indexentry{list}{99} -\indexentry{element}{99} -\indexentry{index}{99} -\indexentry{nested list}{100} -\indexentry{list!traversal}{100} -\indexentry{mapping}{100} -\indexentry{accumulator}{100} -\indexentry{assignment!augmented}{100} -\indexentry{augmented assignment}{100} -\indexentry{traversal}{100} -\indexentry{reduce pattern}{100} -\indexentry{pattern!reduce}{100} -\indexentry{map pattern}{100} -\indexentry{pattern!map}{100} -\indexentry{filter pattern}{100} -\indexentry{pattern!filter}{100} -\indexentry{object}{100} -\indexentry{equivalent}{100} -\indexentry{identical}{100} -\indexentry{reference}{100} -\indexentry{aliasing}{100} -\indexentry{delimiter}{100} -\indexentry{precondition}{100} -\indexentry{anagram}{100} -\indexentry{birthday paradox}{100} -\indexentry{duplicate}{100} -\indexentry{random module}{100} -\indexentry{module!random}{100} -\indexentry{randint function}{100} -\indexentry{function!randint}{100} -\indexentry{duplicate}{101} -\indexentry{uniqueness}{101} -\indexentry{append method}{101} -\indexentry{method append}{101} -\indexentry{list!concatenation}{101} -\indexentry{concatenation!list}{101} -\indexentry{membership!bisection search}{101} -\indexentry{bisection search}{101} -\indexentry{search, bisection}{101} -\indexentry{membership!binary search}{101} -\indexentry{binary search}{101} -\indexentry{search, binary}{101} -\indexentry{bisect module}{101} -\indexentry{module!bisect}{101} -\indexentry{reverse word pair}{101} -\indexentry{interlocking words}{101} -\indexentry{dictionary}{103} -\indexentry{dictionary}{103} -\indexentry{type!dict}{103} -\indexentry{key}{103} -\indexentry{key-value pair}{103} -\indexentry{index}{103} -\indexentry{dict function}{103} -\indexentry{function!dict}{103} -\indexentry{squiggly bracket}{103} -\indexentry{bracket!squiggly}{103} -\indexentry{exception!KeyError}{104} -\indexentry{KeyError}{104} -\indexentry{len function}{104} -\indexentry{function!len}{104} -\indexentry{membership!dictionary}{104} -\indexentry{in operator}{104} -\indexentry{operator!in}{104} -\indexentry{values method}{104} -\indexentry{method!values}{104} -\indexentry{hashtable}{104} -\indexentry{set membership}{104} -\indexentry{membership!set}{104} -\indexentry{counter}{104} -\indexentry{implementation}{105} -\indexentry{histogram}{105} -\indexentry{frequency}{105} -\indexentry{traversal}{105} -\indexentry{histogram}{105} -\indexentry{get method}{105} -\indexentry{method!get}{105} -\indexentry{dictionary!looping with}{106} -\indexentry{looping!with dictionaries}{106} -\indexentry{traversal}{106} -\indexentry{keys method}{106} -\indexentry{method!keys}{106} -\indexentry{dictionary!lookup}{106} -\indexentry{dictionary!reverse lookup}{106} -\indexentry{lookup, dictionary}{106} -\indexentry{reverse lookup, dictionary}{106} -\indexentry{search}{107} -\indexentry{pattern!search}{107} -\indexentry{raise statement}{107} -\indexentry{statement!raise}{107} -\indexentry{exception!ValueError}{107} -\indexentry{ValueError}{107} -\indexentry{traceback}{107} -\indexentry{optional argument}{107} -\indexentry{argument!optional}{107} -\indexentry{invert dictionary}{107} -\indexentry{dictionary!invert}{107} -\indexentry{singleton}{108} -\indexentry{state diagram}{108} -\indexentry{diagram!state}{108} -\indexentry{TypeError}{108} -\indexentry{exception!TypeError}{108} -\indexentry{hash function}{108} -\indexentry{hashable}{108} -\indexentry{immutability}{108} -\indexentry{setdefault method}{109} -\indexentry{method!setdefault}{109} -\indexentry{fibonacci function}{109} -\indexentry{function!fibonacci}{109} -\indexentry{function frame}{109} -\indexentry{frame}{109} -\indexentry{call graph}{109} -\indexentry{memo}{109} -\indexentry{global variable}{110} -\indexentry{variable!global}{110} -\indexentry{flag}{110} -\indexentry{multiple assignment}{110} -\indexentry{assignment!multiple}{110} -\indexentry{global statement}{110} -\indexentry{statement!global}{110} -\indexentry{declaration}{110} -\indexentry{update!global variable}{110} -\indexentry{global variable!update}{110} -\indexentry{UnboundLocalError}{111} -\indexentry{exception!UnboundLocalError}{111} -\indexentry{counter}{111} -\indexentry{mutability}{111} -\indexentry{long integer}{111} -\indexentry{integer!long}{111} -\indexentry{type!long}{111} -\indexentry{Python 3.0}{111} -\indexentry{encryption}{112} -\indexentry{RSA algorithm}{112} -\indexentry{algorithm!RSA}{112} -\indexentry{debugging}{112} -\indexentry{sanity check}{112} -\indexentry{consistency check}{112} -\indexentry{pretty print}{112} -\indexentry{pprint module}{112} -\indexentry{module!pprint}{112} -\indexentry{scaffolding}{112} -\indexentry{dictionary}{112} -\indexentry{key-value pair}{112} -\indexentry{item!dictionary}{112} -\indexentry{key}{112} -\indexentry{value}{112} -\indexentry{implementation}{113} -\indexentry{hashtable}{113} -\indexentry{hash function}{113} -\indexentry{hashable}{113} -\indexentry{lookup}{113} -\indexentry{reverse lookup, dictionary}{113} -\indexentry{singleton}{113} -\indexentry{call graph}{113} -\indexentry{diagram!call graph}{113} -\indexentry{histogram}{113} -\indexentry{memo}{113} -\indexentry{global variable}{113} -\indexentry{flag}{113} -\indexentry{declaration}{113} -\indexentry{duplicate}{113} -\indexentry{letter rotation}{113} -\indexentry{rotation!letters}{113} -\indexentry{Car Talk}{113} -\indexentry{Puzzler}{113} -\indexentry{homophone}{114} -\indexentry{reducible word}{114} -\indexentry{word, reducible}{114} -\indexentry{tuple}{115} -\indexentry{type!tuple}{115} -\indexentry{sequence}{115} -\indexentry{mutability}{115} -\indexentry{immutability}{115} -\indexentry{parentheses!tuples in}{115} -\indexentry{singleton}{115} -\indexentry{tuple!singleton}{115} -\indexentry{tuple function}{115} -\indexentry{function!tuple}{115} -\indexentry{bracket operator}{116} -\indexentry{operator!bracket}{116} -\indexentry{slice operator}{116} -\indexentry{operator!slice}{116} -\indexentry{tuple!slice}{116} -\indexentry{slice!tuple}{116} -\indexentry{exception!TypeError}{116} -\indexentry{TypeError}{116} -\indexentry{item assignment}{116} -\indexentry{assignment!item}{116} -\indexentry{tuple!assignment}{116} -\indexentry{assignment!tuple}{116} -\indexentry{swap pattern}{116} -\indexentry{pattern!swap}{116} -\indexentry{exception!ValueError}{116} -\indexentry{ValueError}{116} -\indexentry{split method}{116} -\indexentry{method!split}{116} -\indexentry{email address}{116} -\indexentry{tuple}{117} -\indexentry{value!tuple}{117} -\indexentry{return value!tuple}{117} -\indexentry{function, tuple as return value}{117} -\indexentry{divmod}{117} -\indexentry{tuple assignment}{117} -\indexentry{assignment!tuple}{117} -\indexentry{max function}{117} -\indexentry{function!max}{117} -\indexentry{min function}{117} -\indexentry{function!min}{117} -\indexentry{variable-length argument tuple}{117} -\indexentry{argument!variable-length tuple}{117} -\indexentry{gather}{117} -\indexentry{parameter!gather}{117} -\indexentry{argument!gather}{117} -\indexentry{scatter}{117} -\indexentry{argument scatter}{117} -\indexentry{TypeError}{117} -\indexentry{exception!TypeError}{117} -\indexentry{max function}{118} -\indexentry{function!max}{118} -\indexentry{min function}{118} -\indexentry{function!min}{118} -\indexentry{sum function}{118} -\indexentry{function!sum}{118} -\indexentry{zip function}{118} -\indexentry{function!zip}{118} -\indexentry{Python 3.0}{118} -\indexentry{list!of tuples}{118} -\indexentry{traversal}{118} -\indexentry{tuple assignment}{118} -\indexentry{assignment!tuple}{118} -\indexentry{loop}{118} -\indexentry{for loop}{119} -\indexentry{traversal}{119} -\indexentry{enumerate function}{119} -\indexentry{function!enumerate}{119} -\indexentry{dictionary}{119} -\indexentry{items method}{119} -\indexentry{method!items}{119} -\indexentry{key-value pair}{119} -\indexentry{dictionary!initialize}{119} -\indexentry{zip function!use with dict}{119} -\indexentry{update method}{119} -\indexentry{method!update}{119} -\indexentry{traverse!dictionary}{119} -\indexentry{dictionary!traversal}{119} -\indexentry{tuple!as key in dictionary}{120} -\indexentry{hashable}{120} -\indexentry{tuple!in brackets}{120} -\indexentry{state diagram}{120} -\indexentry{diagram!state}{120} -\indexentry{comparison!tuple}{121} -\indexentry{tuple!comparison}{121} -\indexentry{sort method}{121} -\indexentry{method!sort}{121} -\indexentry{DSU pattern}{121} -\indexentry{pattern!DSU}{121} -\indexentry{decorate-sort-undecorate pattern}{121} -\indexentry{pattern!decorate-sort-undecorate}{121} -\indexentry{keyword argument}{121} -\indexentry{argument!keyword}{121} -\indexentry{traversal}{121} -\indexentry{random module}{121} -\indexentry{module!random}{121} -\indexentry{random function}{121} -\indexentry{function!random}{121} -\indexentry{sequence}{121} -\indexentry{string}{122} -\indexentry{list}{122} -\indexentry{tuple}{122} -\indexentry{mutability}{122} -\indexentry{immutability}{122} -\indexentry{sorted function}{122} -\indexentry{function!sorted}{122} -\indexentry{reversed function}{122} -\indexentry{function!reversed}{122} -\indexentry{debugging}{122} -\indexentry{data structure}{122} -\indexentry{shape error}{122} -\indexentry{error!shape}{122} -\indexentry{structshape module}{122} -\indexentry{module!structshape}{122} -\indexentry{tuple}{123} -\indexentry{tuple assignment}{123} -\indexentry{assignment!tuple}{123} -\indexentry{gather}{123} -\indexentry{scatter}{123} -\indexentry{DSU pattern}{123} -\indexentry{data structure}{123} -\indexentry{shape}{123} -\indexentry{letter frequency}{123} -\indexentry{frequency!letter}{123} -\indexentry{anagram set}{123} -\indexentry{set!anagram}{123} -\indexentry{Scrabble}{124} -\indexentry{bingo}{124} -\indexentry{metathesis}{124} -\indexentry{Car Talk}{124} -\indexentry{Puzzler}{124} -\indexentry{reducible word}{124} -\indexentry{word, reducible}{124} -\indexentry{recursive definition}{124} -\indexentry{definition!recursive}{124} -\indexentry{string module}{125} -\indexentry{module!string}{125} -\indexentry{strip method}{125} -\indexentry{method!strip}{125} -\indexentry{replace method}{125} -\indexentry{method!replace}{125} -\indexentry{translate method}{125} -\indexentry{method!translate}{125} -\indexentry{Project Gutenberg}{125} -\indexentry{plain text}{125} -\indexentry{text!plain}{125} -\indexentry{word frequency}{125} -\indexentry{frequency!word}{125} -\indexentry{random number}{126} -\indexentry{number, random}{126} -\indexentry{deterministic}{126} -\indexentry{pseudorandom}{126} -\indexentry{random module}{126} -\indexentry{module!random}{126} -\indexentry{random function}{126} -\indexentry{function!random}{126} -\indexentry{randint function}{126} -\indexentry{function!randint}{126} -\indexentry{choice function}{126} -\indexentry{function!choice}{126} -\indexentry{histogram!random choice}{126} -\indexentry{histogram!word frequencies}{127} -\indexentry{Austin, Jane}{127} -\indexentry{accumulator!histogram}{127} -\indexentry{traversal}{127} -\indexentry{update!histogram}{127} -\indexentry{DSU pattern}{128} -\indexentry{pattern!DSU}{128} -\indexentry{optional parameter}{128} -\indexentry{parameter!optional}{128} -\indexentry{default value}{128} -\indexentry{value!default}{128} -\indexentry{override}{129} -\indexentry{dictionary!subtraction}{129} -\indexentry{subtraction!dictionary}{129} -\indexentry{set}{129} -\indexentry{type!set}{129} -\indexentry{histogram!random choice}{129} -\indexentry{algorithm}{130} -\indexentry{Markov analysis}{130} -\indexentry{prefix}{131} -\indexentry{suffix}{131} -\indexentry{mapping}{131} -\indexentry{random text}{131} -\indexentry{text!random}{131} -\indexentry{mash-up}{131} -\indexentry{data structure}{131} -\indexentry{implementation}{132} -\indexentry{tuple!as key in dictionary}{132} -\indexentry{benchmarking}{132} -\indexentry{profile module}{132} -\indexentry{module!profile}{132} -\indexentry{debugging}{132} -\indexentry{typographical error}{133} -\indexentry{experimental debugging}{133} -\indexentry{random walk programming}{133} -\indexentry{development plan!random walk programming}{133} -\indexentry{deterministic}{133} -\indexentry{pseudorandom}{133} -\indexentry{default value}{133} -\indexentry{override}{134} -\indexentry{benchmarking}{134} -\indexentry{word frequency}{134} -\indexentry{frequency!word}{134} -\indexentry{Zipf's law}{134} -\indexentry{logarithm}{134} -\indexentry{file}{135} -\indexentry{type!file}{135} -\indexentry{persistence}{135} -\indexentry{pickle module}{135} -\indexentry{module!pickle}{135} -\indexentry{file!reading and writing}{135} -\indexentry{open function}{135} -\indexentry{function!open}{135} -\indexentry{close method}{136} -\indexentry{method!close}{136} -\indexentry{format operator}{136} -\indexentry{operator!format}{136} -\indexentry{format string}{136} -\indexentry{format sequence}{136} -\indexentry{exception!TypeError}{136} -\indexentry{TypeError}{136} -\indexentry{filename}{137} -\indexentry{path}{137} -\indexentry{directory}{137} -\indexentry{folder}{137} -\indexentry{os module}{137} -\indexentry{module!os}{137} -\indexentry{getcwd function}{137} -\indexentry{function!getcwd}{137} -\indexentry{working directory}{137} -\indexentry{directory!working}{137} -\indexentry{relative path}{137} -\indexentry{path!relative}{137} -\indexentry{absolute path}{137} -\indexentry{path!absolute}{137} -\indexentry{exists function}{137} -\indexentry{function!exists}{137} -\indexentry{walk, directory}{138} -\indexentry{directory!walk}{138} -\indexentry{open function}{138} -\indexentry{function!open}{138} -\indexentry{exception!IOError}{138} -\indexentry{IOError}{138} -\indexentry{file!permission}{138} -\indexentry{permission, file}{138} -\indexentry{exception, catching}{138} -\indexentry{try statement}{138} -\indexentry{statement!try}{138} -\indexentry{database}{139} -\indexentry{anydbm module}{139} -\indexentry{module!anydbm}{139} -\indexentry{open function}{139} -\indexentry{function!open}{139} -\indexentry{update!database}{139} -\indexentry{dictionary methods!anydbm module}{139} -\indexentry{close method}{139} -\indexentry{method!close}{139} -\indexentry{pickling}{139} -\indexentry{pickle module}{139} -\indexentry{module!pickle}{139} -\indexentry{shelve module}{140} -\indexentry{module!shelve}{140} -\indexentry{anagram set}{140} -\indexentry{set!anagram}{140} -\indexentry{shell}{140} -\indexentry{pipe}{140} -\indexentry{ls (Unix command)}{140} -\indexentry{Unix command!ls}{140} -\indexentry{popen function}{140} -\indexentry{function!popen}{140} -\indexentry{readline method}{141} -\indexentry{method!readline}{141} -\indexentry{read method}{141} -\indexentry{method!read}{141} -\indexentry{close method}{141} -\indexentry{method!close}{141} -\indexentry{file!compression}{141} -\indexentry{compression!file}{141} -\indexentry{Unix command!gunzip}{141} -\indexentry{gunzip (Unix command)}{141} -\indexentry{module, writing}{141} -\indexentry{word count}{141} -\indexentry{module object}{141} -\indexentry{object!module}{141} -\indexentry{import statement}{142} -\indexentry{statement!import}{142} -\indexentry{module!reload}{142} -\indexentry{reload function}{142} -\indexentry{function!reload}{142} -\indexentry{debugging}{142} -\indexentry{whitespace}{142} -\indexentry{repr function}{142} -\indexentry{function!repr}{142} -\indexentry{string representation}{142} -\indexentry{end of line character}{142} -\indexentry{persistence}{143} -\indexentry{format operator}{143} -\indexentry{operator!format}{143} -\indexentry{format string}{143} -\indexentry{format sequence}{143} -\indexentry{text file}{143} -\indexentry{directory}{143} -\indexentry{path}{143} -\indexentry{relative path}{143} -\indexentry{absolute path}{143} -\indexentry{catch}{143} -\indexentry{database}{143} -\indexentry{urllib module}{143} -\indexentry{module!urllib}{143} -\indexentry{URL}{143} -\indexentry{secret exercise}{143} -\indexentry{exercise, secret}{143} -\indexentry{MP3}{143} -\indexentry{duplicate}{143} -\indexentry{MD5 algorithm}{143} -\indexentry{algorithm!MD5}{143} -\indexentry{checksum}{143} -\indexentry{pipe}{143} -\indexentry{Internet Movie Database (IMDb)}{144} -\indexentry{IMDb (Internet Movie Database)}{144} -\indexentry{database}{144} -\indexentry{plain text}{144} -\indexentry{text!plain}{144} -\indexentry{parse}{144} -\indexentry{shelve module}{144} -\indexentry{module!shelve}{144} -\indexentry{Bacon, Kevin}{144} -\indexentry{Kevin Bacon Game}{144} -\indexentry{user-defined type}{145} -\indexentry{type!user-defined}{145} -\indexentry{point, mathematical}{145} -\indexentry{representation}{145} -\indexentry{class}{145} -\indexentry{object}{145} -\indexentry{class definition}{145} -\indexentry{definition!class}{145} -\indexentry{Point class}{145} -\indexentry{class!Point}{145} -\indexentry{docstring}{145} -\indexentry{object!class}{146} -\indexentry{class object}{146} -\indexentry{instance}{146} -\indexentry{instantiation}{146} -\indexentry{hexadecimal}{146} -\indexentry{instance attribute}{146} -\indexentry{attribute!instance}{146} -\indexentry{dot notation}{146} -\indexentry{state diagram}{146} -\indexentry{diagram!state}{146} -\indexentry{object diagram}{146} -\indexentry{diagram!object}{146} -\indexentry{instance!as argument}{147} -\indexentry{aliasing}{147} -\indexentry{representation}{147} -\indexentry{Rectangle class}{147} -\indexentry{class!Rectangle}{147} -\indexentry{state diagram}{148} -\indexentry{diagram!state}{148} -\indexentry{object diagram}{148} -\indexentry{diagram!object}{148} -\indexentry{embedded object}{148} -\indexentry{object!embedded}{148} -\indexentry{instance!as return value}{148} -\indexentry{return value}{148} -\indexentry{object!mutable}{148} -\indexentry{mutability}{148} -\indexentry{aliasing}{149} -\indexentry{copying objects}{149} -\indexentry{object!copying}{149} -\indexentry{copy module}{149} -\indexentry{module!copy}{149} -\indexentry{is operator}{149} -\indexentry{operator!is}{149} -\indexentry{embedded object!copying}{149} -\indexentry{state diagram}{150} -\indexentry{diagram!state}{150} -\indexentry{object diagram}{150} -\indexentry{diagram!object}{150} -\indexentry{shallow copy}{150} -\indexentry{copy!shallow}{150} -\indexentry{deep copy}{150} -\indexentry{copy!deep}{150} -\indexentry{deepcopy function}{150} -\indexentry{function!deepcopy}{150} -\indexentry{debugging}{150} -\indexentry{exception!AttributeError}{150} -\indexentry{AttributeError}{150} -\indexentry{type function}{150} -\indexentry{function!type}{150} -\indexentry{hasattr function}{150} -\indexentry{function!hasattr}{150} -\indexentry{class}{151} -\indexentry{class object}{151} -\indexentry{instance}{151} -\indexentry{attribute!instance}{151} -\indexentry{instance attribute}{151} -\indexentry{embedded object}{151} -\indexentry{object!embedded}{151} -\indexentry{shallow copy}{151} -\indexentry{deep copy}{151} -\indexentry{object diagram}{151} -\indexentry{diagram!object}{151} -\indexentry{Swampy}{151} -\indexentry{World module}{151} -\indexentry{module!World}{151} -\indexentry{Canvas object}{151} -\indexentry{object!Canvas}{151} -\indexentry{bounding box}{152} -\indexentry{Bangladesh, national flag}{152} -\indexentry{Czech Republic, national flag}{152} -\indexentry{color list}{152} -\indexentry{available colors}{152} -\indexentry{user-defined type}{153} -\indexentry{type!user-defined}{153} -\indexentry{Time class}{153} -\indexentry{class!Time}{153} -\indexentry{state diagram}{153} -\indexentry{diagram!state}{153} -\indexentry{object diagram}{153} -\indexentry{diagram!object}{153} -\indexentry{boolean function}{153} -\indexentry{prototype and patch}{154} -\indexentry{development plan!prototype and patch}{154} -\indexentry{pure function}{154} -\indexentry{function type!pure}{154} -\indexentry{Monty Python and the Holy Grail}{154} -\indexentry{carrying, addition with}{154} -\indexentry{modifier}{155} -\indexentry{function type!modifier}{155} -\indexentry{increment}{155} -\indexentry{special case}{155} -\indexentry{functional programming style}{155} -\indexentry{prototype and patch}{156} -\indexentry{development plan!prototype and patch}{156} -\indexentry{planned development}{156} -\indexentry{development plan!planned}{156} -\indexentry{sexagesimal}{156} -\indexentry{carrying, addition with}{156} -\indexentry{divmod}{156} -\indexentry{consistency check}{156} -\indexentry{subtraction with borrowing}{157} -\indexentry{borrowing, subtraction with}{157} -\indexentry{generalization}{157} -\indexentry{debugging}{157} -\indexentry{invariant}{157} -\indexentry{raise statement}{157} -\indexentry{statement!raise}{157} -\indexentry{assert statement}{157} -\indexentry{statement!assert}{157} -\indexentry{prototype and patch}{158} -\indexentry{planned development}{158} -\indexentry{pure function}{158} -\indexentry{modifier}{158} -\indexentry{functional programming style}{158} -\indexentry{invariant}{158} -\indexentry{running pace}{158} -\indexentry{Date class}{158} -\indexentry{class!Date}{158} -\indexentry{datetime module}{158} -\indexentry{module!datetime}{158} -\indexentry{birthday}{158} -\indexentry{object-oriented programming}{159} -\indexentry{method}{159} -\indexentry{function}{159} -\indexentry{syntax}{159} -\indexentry{semantics}{159} -\indexentry{object!printing}{160} -\indexentry{indentation}{160} -\indexentry{function syntax}{160} -\indexentry{dot notation}{160} -\indexentry{method syntax}{160} -\indexentry{subject}{160} -\indexentry{self (parameter name)}{161} -\indexentry{parameter!self}{161} -\indexentry{metaphor, method invocation}{161} -\indexentry{increment}{161} -\indexentry{exception!TypeError}{161} -\indexentry{TypeError}{161} -\indexentry{other (parameter name)}{162} -\indexentry{parameter!other}{162} -\indexentry{init method}{162} -\indexentry{method!init}{162} -\indexentry{optional parameter}{162} -\indexentry{parameter!optional}{162} -\indexentry{default value}{162} -\indexentry{override}{162} -\indexentry{Point class}{163} -\indexentry{class!Point}{163} -\indexentry{str method@\_\_str\_\_ method}{163} -\indexentry{method!\_\_str\_\_}{163} -\indexentry{string representation}{163} -\indexentry{print statement}{163} -\indexentry{statement!print}{163} -\indexentry{add method}{163} -\indexentry{method!add}{163} -\indexentry{operator overloading}{164} -\indexentry{isinstance function}{164} -\indexentry{function!isinstance}{164} -\indexentry{type-based dispatch}{164} -\indexentry{dispatch, type-based}{164} -\indexentry{commutativity}{165} -\indexentry{radd method}{165} -\indexentry{method!radd}{165} -\indexentry{type-based dispatch}{165} -\indexentry{dispatch!type-based}{165} -\indexentry{polymorphism}{166} -\indexentry{debugging}{166} -\indexentry{init method}{166} -\indexentry{attribute!initializing}{166} -\indexentry{hasattr function}{166} -\indexentry{function!hasattr}{166} -\indexentry{dict attribute@\_\_dict\_\_ attribute}{166} -\indexentry{attribute!\_\_dict\_\_}{166} -\indexentry{traversal!dictionary}{166} -\indexentry{dictionary!traversal}{166} -\indexentry{getattr function}{166} -\indexentry{function!getattr}{166} -\indexentry{object-oriented language}{166} -\indexentry{object-oriented programming}{167} -\indexentry{method}{167} -\indexentry{subject}{167} -\indexentry{overloading}{167} -\indexentry{operator!overloading}{167} -\indexentry{type-based dispatch}{167} -\indexentry{polymorphism}{167} -\indexentry{default value!avoiding mutable}{167} -\indexentry{mutable object, as default value}{167} -\indexentry{worst bug}{167} -\indexentry{bug!worst}{167} -\indexentry{Kangaroo class}{167} -\indexentry{class!Kangaroo}{167} -\indexentry{aliasing}{167} -\indexentry{embedded object}{167} -\indexentry{object!embedded}{167} -\indexentry{Visual module}{167} -\indexentry{module!Visual}{167} -\indexentry{vpython module}{167} -\indexentry{module!vpython}{167} -\indexentry{color list}{168} -\indexentry{available colors}{168} -\indexentry{playing card, Anglo-American}{169} -\indexentry{card, playing}{169} -\indexentry{poker}{169} -\indexentry{rank}{169} -\indexentry{suit}{169} -\indexentry{encode}{169} -\indexentry{encrypt}{169} -\indexentry{map to}{169} -\indexentry{representation}{169} -\indexentry{Card class}{170} -\indexentry{class!Card}{170} -\indexentry{init method}{170} -\indexentry{method!init}{170} -\indexentry{class attribute}{170} -\indexentry{attribute!class}{170} -\indexentry{instance attribute}{170} -\indexentry{attribute!instance}{170} -\indexentry{dot notation}{170} -\indexentry{state diagram}{171} -\indexentry{diagram!state}{171} -\indexentry{object diagram}{171} -\indexentry{diagram!object}{171} -\indexentry{operator!relational}{171} -\indexentry{relational operator}{171} -\indexentry{override}{171} -\indexentry{operator overloading}{171} -\indexentry{cmp method@\_\_cmp\_\_ method}{171} -\indexentry{method!\_\_cmp\_\_}{171} -\indexentry{tuple!comparison}{172} -\indexentry{comparison!tuple}{172} -\indexentry{cmp function}{172} -\indexentry{function!cmp}{172} -\indexentry{list!of objects}{172} -\indexentry{deck, playing cards}{172} -\indexentry{init method}{172} -\indexentry{method!init}{172} -\indexentry{composition}{172} -\indexentry{loop!nested}{172} -\indexentry{Deck class}{172} -\indexentry{class!Deck}{172} -\indexentry{append method}{172} -\indexentry{method!append}{172} -\indexentry{str method@\_\_str\_\_ method}{172} -\indexentry{method!\_\_str\_\_}{172} -\indexentry{accumulator!string}{173} -\indexentry{string!accumulator}{173} -\indexentry{join method}{173} -\indexentry{method!join}{173} -\indexentry{newline}{173} -\indexentry{pop method}{173} -\indexentry{method!pop}{173} -\indexentry{append method}{173} -\indexentry{method!append}{173} -\indexentry{veneer}{173} -\indexentry{random module}{174} -\indexentry{module!random}{174} -\indexentry{shuffle function}{174} -\indexentry{function!shuffle}{174} -\indexentry{sort method}{174} -\indexentry{method!sort}{174} -\indexentry{inheritance}{174} -\indexentry{object-oriented programming}{174} -\indexentry{parent class}{174} -\indexentry{child class}{174} -\indexentry{class!child}{174} -\indexentry{subclass}{174} -\indexentry{superclass}{174} -\indexentry{parentheses!parent class in}{174} -\indexentry{parent class}{174} -\indexentry{class!parent}{174} -\indexentry{Hand class}{174} -\indexentry{class!Hand}{174} -\indexentry{override}{174} -\indexentry{init method}{174} -\indexentry{method!init}{174} -\indexentry{encapsulation}{175} -\indexentry{IS-A relationship}{176} -\indexentry{HAS-A relationship}{176} -\indexentry{class diagram}{176} -\indexentry{diagram!class}{176} -\indexentry{UML}{176} -\indexentry{multiplicity (in class diagram)}{176} -\indexentry{debugging}{176} -\indexentry{polymorphism}{176} -\indexentry{flow of execution}{177} -\indexentry{mro method}{177} -\indexentry{method!mro}{177} -\indexentry{method resolution order}{177} -\indexentry{override}{177} -\indexentry{interface}{177} -\indexentry{precondition}{177} -\indexentry{postcondition}{177} -\indexentry{encode}{177} -\indexentry{class attribute}{177} -\indexentry{attribute!class}{177} -\indexentry{instance attribute}{177} -\indexentry{attribute!instance}{177} -\indexentry{veneer}{177} -\indexentry{inheritance}{177} -\indexentry{parent class}{177} -\indexentry{child class}{177} -\indexentry{class!child}{177} -\indexentry{IS-A relationship}{178} -\indexentry{HAS-A relationship}{178} -\indexentry{class diagram}{178} -\indexentry{diagram!class}{178} -\indexentry{multiplicity (in class diagram)}{178} -\indexentry{poker}{178} -\indexentry{Swampy}{179} -\indexentry{TurtleWorld}{179} -\indexentry{Tagger}{179} -\indexentry{GUI}{181} -\indexentry{graphical user interface}{181} -\indexentry{Tkinter}{181} -\indexentry{Gui module}{181} -\indexentry{module!Gui}{181} -\indexentry{Swampy}{181} -\indexentry{event loop}{181} -\indexentry{loop!event}{181} -\indexentry{infinite loop}{181} -\indexentry{loop!infinite}{181} -\indexentry{widget}{181} -\indexentry{Button widget}{182} -\indexentry{widget!Button}{182} -\indexentry{option}{182} -\indexentry{keyword argument}{182} -\indexentry{argument!keyword}{182} -\indexentry{Label widget}{182} -\indexentry{widget!Label}{182} -\indexentry{callback}{182} -\indexentry{event-driven programming}{182} -\indexentry{Canvas widget}{183} -\indexentry{widget!Canvas}{183} -\indexentry{config method}{183} -\indexentry{method!config}{183} -\indexentry{Canvas item}{183} -\indexentry{item!Canvas}{183} -\indexentry{Canvas coordinate}{183} -\indexentry{coordinate!Canvas}{183} -\indexentry{coordinate sequence}{184} -\indexentry{sequence!coordinate}{184} -\indexentry{bounding box}{184} -\indexentry{Text widget}{184} -\indexentry{widget!Text}{184} -\indexentry{Entry widget}{184} -\indexentry{widget!Entry}{184} -\indexentry{SimpleTurtleWorld class}{186} -\indexentry{class!SimpleTurtleWorld}{186} -\indexentry{packing widgets}{186} -\indexentry{widget, packing}{186} -\indexentry{Frame widget}{186} -\indexentry{widget!Frame}{186} -\indexentry{callback}{187} -\indexentry{bound method}{187} -\indexentry{method, bound}{187} -\indexentry{subject}{187} -\indexentry{geometry manager}{188} -\indexentry{Menubutton widget}{188} -\indexentry{widget!Menubutton}{188} -\indexentry{callback}{188} -\indexentry{Callable object}{188} -\indexentry{object!Callable}{188} -\indexentry{binding}{189} -\indexentry{callback}{189} -\indexentry{event string}{189} -\indexentry{event handler}{189} -\indexentry{Event object}{189} -\indexentry{object!Event}{189} -\indexentry{drag-and-drop}{189} -\indexentry{update!coordinate}{190} -\indexentry{Canvas coordinate}{190} -\indexentry{coordinate!Canvas}{190} -\indexentry{pixel coordinate}{190} -\indexentry{coordinate!pixel}{190} -\indexentry{debugging}{191} -\indexentry{callback}{191} -\indexentry{flow of execution}{191} -\indexentry{event-driven programming}{191} -\indexentry{invariant}{191} -\indexentry{GUI}{191} -\indexentry{widget}{191} -\indexentry{option}{192} -\indexentry{keyword argument}{192} -\indexentry{callback}{192} -\indexentry{bound method}{192} -\indexentry{event-driven programming}{192} -\indexentry{event}{192} -\indexentry{event loop}{192} -\indexentry{item!Canvas}{192} -\indexentry{bounding box}{192} -\indexentry{packing widgets}{192} -\indexentry{geometry manager}{192} -\indexentry{binding}{192} -\indexentry{image viewer}{192} -\indexentry{Python Imaging Library (PIL)}{192} -\indexentry{PIL (Python Imaging Library)}{192} -\indexentry{Image module}{192} -\indexentry{module!Image}{192} -\indexentry{bug!worst ever}{193} -\indexentry{worst bug!ever}{193} -\indexentry{vector graphics}{193} -\indexentry{SVG}{193} -\indexentry{urllib module}{193} -\indexentry{module!urllib}{193} -\indexentry{URL}{193} -\indexentry{HTMLParser module}{193} -\indexentry{module!HTMLParser}{193} -\indexentry{plain text}{193} -\indexentry{text!plain}{193} -\indexentry{hyperlink}{193} -\indexentry{debugging}{195} -\indexentry{syntax error}{195} -\indexentry{runtime error}{195} -\indexentry{semantic error}{195} -\indexentry{error!compile-time}{195} -\indexentry{error!syntax}{195} -\indexentry{error!runtime}{195} -\indexentry{error!semantic}{195} -\indexentry{exception}{195} -\indexentry{error message}{195} -\indexentry{incremental development}{195} -\indexentry{development plan!incremental}{195} -\indexentry{syntax}{196} -\indexentry{keyword}{196} -\indexentry{header}{196} -\indexentry{colon}{196} -\indexentry{quotation mark}{196} -\indexentry{multiline string}{196} -\indexentry{string!multiline}{196} -\indexentry{conditional}{196} -\indexentry{indentation}{196} -\indexentry{whitespace}{196} -\indexentry{module!reload}{196} -\indexentry{reload function}{196} -\indexentry{function!reload}{196} -\indexentry{infinite loop}{197} -\indexentry{infinite recursion}{197} -\indexentry{hanging}{197} -\indexentry{infinite loop}{197} -\indexentry{loop!infinite}{197} -\indexentry{condition}{197} -\indexentry{loop!condition}{197} -\indexentry{infinite recursion}{198} -\indexentry{recursion!infinite}{198} -\indexentry{flow of execution}{198} -\indexentry{exception}{198} -\indexentry{runtime error}{198} -\indexentry{traceback}{198} -\indexentry{NameError}{198} -\indexentry{TypeError}{198} -\indexentry{exception!NameError}{198} -\indexentry{exception!TypeError}{198} -\indexentry{index}{198} -\indexentry{format operator}{198} -\indexentry{operator!format}{198} -\indexentry{KeyError}{199} -\indexentry{exception!KeyError}{199} -\indexentry{dictionary}{199} -\indexentry{AttributeError}{199} -\indexentry{exception!AttributeError}{199} -\indexentry{IndexError}{199} -\indexentry{exception!IndexError}{199} -\indexentry{debugger (pdb)}{199} -\indexentry{Python debugger (pdb)}{199} -\indexentry{pdb (Python debugger)}{199} -\indexentry{print statement}{199} -\indexentry{statement!print}{199} -\indexentry{dead code}{199} -\indexentry{testing!minimal test case}{199} -\indexentry{test case, minimal}{199} -\indexentry{semantic error}{199} -\indexentry{error!semantic}{199} -\indexentry{model, mental}{200} -\indexentry{mental model}{200} -\indexentry{expression!big and hairy}{200} -\indexentry{big, hairy expression}{200} -\indexentry{temporary variable}{201} -\indexentry{variable!temporary}{201} -\indexentry{order of operations}{201} -\indexentry{precedence}{201} -\indexentry{return statement}{201} -\indexentry{statement!return}{201} -\indexentry{frustration}{201} -\indexentry{rage}{201} -\indexentry{debugging!emotional response}{201} -\indexentry{emotional debugging}{201} -\indexentry{debugging!superstition}{201} -\indexentry{superstitious debugging}{201} -\indexentry{random walk programming}{201} -\indexentry{development plan!random walk programming}{201} diff --git a/thinkpython/tex/book.ilg b/thinkpython/tex/book.ilg deleted file mode 100644 index 9279101..0000000 --- a/thinkpython/tex/book.ilg +++ /dev/null @@ -1,6 +0,0 @@ -This is makeindex, version 2.15 [TeX Live 2009] (kpathsea + Thai support). -Scanning input file book.idx.....done (1860 entries accepted, 0 rejected). -Sorting entries..................done (21667 comparisons). -Generating output file book.ind.....done (1150 lines written, 0 warnings). -Output written in book.ind. -Transcript written in book.ilg. diff --git a/thinkpython/tex/book.ind b/thinkpython/tex/book.ind deleted file mode 100644 index 99312ac..0000000 --- a/thinkpython/tex/book.ind +++ /dev/null @@ -1,1150 +0,0 @@ -\begin{theindex} - - \item abecedarian, 72, 83 - \item abs function, 52 - \item absolute path, 137, 143 - \item access, 89 - \item accumulator, 100 - \subitem histogram, 127 - \subitem list, 93 - \subitem string, 173 - \subitem sum, 93 - \item Ackerman function, 61 - \item add method, 163 - \item addition with carrying, 68 - \item algorithm, 3, 7, 67, 130 - \subitem Euclid, 62 - \subitem MD5, 143 - \subitem RSA, 112 - \subitem square root, 69 - \item aliasing, 96, 100, 147, 149, 167 - \subitem copying to avoid, 99 - \item alphabet, 37 - \item alternative execution, 41 - \item ambiguity, 5 - \item anagram, 100 - \item anagram set, 123, 140 - \item and operator, 40 - \item anydbm module, 139 - \item append method, 92, 98, 101, 172, 173 - \item arc function, 31 - \item argument, 17, 19, 21, 22, 26, 97 - \subitem gather, 117 - \subitem keyword, 33, 36, 121, 182 - \subitem list, 97 - \subitem optional, 76, 95, 107 - \subitem variable-length tuple, 117 - \item argument scatter, 117 - \item arithmetic operator, 12 - \item assert statement, 157 - \item assignment, 15, 63, 89 - \subitem augmented, 93, 100 - \subitem item, 74, 90, 116 - \subitem multiple, 68, 110 - \subitem tuple, 116--118, 123 - \item assignment statement, 10 - \item attribute - \subitem \_\_dict\_\_, 166 - \subitem class, 170, 177 - \subitem initializing, 166 - \subitem instance, 146, 151, 170, 177 - \item AttributeError, 150, 199 - \item augmented assignment, 93, 100 - \item Austin, Jane, 127 - \item available colors, 152, 168 - - \indexspace - - \item Bacon, Kevin, 144 - \item Bangladesh, national flag, 152 - \item base case, 44, 47 - \item benchmarking, 132, 134 - \item big, hairy expression, 200 - \item binary search, 101 - \item binding, 188, 191 - \item bingo, 124 - \item birthday, 158 - \item birthday paradox, 100 - \item bisect module, 101 - \item bisection search, 101 - \item bisection, debugging by, 68 - \item bitwise operator, 12 - \item body, 19, 25, 47, 65 - \item bool type, 39 - \item boolean expression, 39, 46 - \item boolean function, 54, 153 - \item boolean operator, 76 - \item borrowing, subtraction with, 68, 157 - \item bound method, 186, 191 - \item bounding box, 152, 184, 191 - \item bracket - \subitem squiggly, 103 - \item bracket operator, 71, 89, 116 - \item branch, 41, 47 - \item break statement, 65 - \item bug, 3, 7 - \subitem worst, 167 - \subitem worst ever, 192 - \item Button widget, 182 - - \indexspace - - \item calculator, 8, 16 - \item call graph, 109, 113 - \item Callable object, 188 - \item callback, 182, 186, 188, 190, 191 - \item Canvas coordinate, 183, 190 - \item Canvas item, 183 - \item Canvas object, 151 - \item Canvas widget, 183 - \item Car Talk, 86, 113, 124 - \item Card class, 170 - \item card, playing, 169 - \item carrying, addition with, 68, 154, 156 - \item case-sensitivity, variable names, 15 - \item catch, 143 - \item chained conditional, 41, 47 - \item character, 71 - \item checksum, 143 - \item child class, 174, 177 - \item choice function, 126 - \item circle function, 31 - \item circular definition, 56 - \item class, 145, 151 - \subitem Card, 170 - \subitem child, 174, 177 - \subitem Date, 158 - \subitem Deck, 172 - \subitem Hand, 174 - \subitem Kangaroo, 167 - \subitem parent, 174 - \subitem Point, 145, 163 - \subitem Rectangle, 147 - \subitem SimpleTurtleWorld, 186 - \subitem Time, 153 - \item class attribute, 170, 177 - \item class definition, 145 - \item class diagram, 176, 178 - \item class object, 146, 151 - \item close method, 136, 139, 141 - \item cmp function, 172 - \item \_\_cmp\_\_ method, 171 - \item Collatz conjecture, 65 - \item colon, 19, 196 - \item color list, 152, 168 - \item comment, 14, 16 - \item commutativity, 14, 165 - \item compare function, 52 - \item comparison - \subitem string, 77 - \subitem tuple, 121, 172 - \item compile, 1, 7 - \item composition, 19, 22, 26, 54, 172 - \item compound statement, 40, 47 - \item compression - \subitem file, 141 - \item concatenation, 14, 16, 23, 72, 74, 95 - \subitem list, 91, 98, 101 - \item condition, 40, 47, 65, 197 - \item conditional, 196 - \subitem chained, 41, 47 - \subitem nested, 42, 47 - \item conditional execution, 40 - \item conditional statement, 40, 47, 55 - \item config method, 183 - \item consistency check, 112, 156 - \item contributors, vii - \item conversion - \subitem type, 17 - \item coordinate - \subitem Canvas, 183, 190 - \subitem pixel, 190 - \item coordinate sequence, 184 - \item copy - \subitem deep, 150 - \subitem shallow, 150 - \subitem slice, 74, 92 - \subitem to avoid aliasing, 99 - \item copy module, 149 - \item copying objects, 149 - \item count method, 76 - \item counter, 75, 79, 104, 111 - \item counting and looping, 75 - \item crosswords, 81 - \item cummings, e. e., 3 - \item cumulative sum, 94 - \item Czech Republic, national flag, 152 - - \indexspace - - \item data structure, 122, 123, 131 - \item database, 139, 143, 144 - \item Date class, 158 - \item datetime module, 158 - \item dead code, 52, 60, 199 - \item debugger (pdb), 199 - \item debugging, 3, 6, 7, 15, 25, 35, 45, 59, 77, 85, 98, 112, 122, - 132, 142, 150, 157, 166, 176, 190, 195 - \subitem by bisection, 68 - \subitem emotional response, 6, 201 - \subitem experimental, 4 - \subitem superstition, 201 - \item Deck class, 172 - \item deck, playing cards, 172 - \item declaration, 110, 113 - \item decorate-sort-undecorate pattern, 121 - \item decrement, 64, 69 - \item deep copy, 150, 151 - \item deepcopy function, 150 - \item def keyword, 19 - \item default value, 128, 133, 162 - \subitem avoiding mutable, 167 - \item definition - \subitem circular, 56 - \subitem class, 145 - \subitem function, 19 - \subitem recursive, 124 - \item del operator, 94 - \item deletion, element of list, 94 - \item delimiter, 95, 100 - \item deterministic, 126, 133 - \item development plan, 36 - \subitem encapsulation and generalization, 35 - \subitem incremental, 52, 195 - \subitem planned, 156 - \subitem problem recognition, 84, 85 - \subitem prototype and patch, 154, 156 - \subitem random walk programming, 133, 201 - \item diagram - \subitem call graph, 113 - \subitem class, 176, 178 - \subitem object, 146, 148, 150, 151, 153, 171 - \subitem stack, 23, 97 - \subitem state, 10, 63, 78, 90, 96, 97, 108, 120, 146, 148, 150, - 153, 171 - \item \_\_dict\_\_ attribute, 166 - \item dict function, 103 - \item dictionary, 103, 112, 119, 199 - \subitem initialize, 119 - \subitem invert, 107 - \subitem lookup, 106 - \subitem looping with, 106 - \subitem reverse lookup, 106 - \subitem subtraction, 129 - \subitem traversal, 119, 166 - \item dictionary methods - \subitem anydbm module, 139 - \item Dijkstra, Edsger, 85 - \item directory, 137, 143 - \subitem walk, 138 - \subitem working, 137 - \item dispatch - \subitem type-based, 165 - \item dispatch, type-based, 164 - \item divisibility, 39 - \item division - \subitem floating-point, 12 - \subitem floor, 12, 46 - \item divmod, 117, 156 - \item docstring, 35, 36, 145 - \item documentation, 8 - \item dot notation, 18, 26, 75, 146, 160, 170 - \item double letters, 86 - \item Doyle, Arthur Conan, 4 - \item drag-and-drop, 189 - \item DSU pattern, 121, 123, 128 - \item duplicate, 100, 101, 113, 143 - - \indexspace - - \item Einstein, Albert, 33 - \item element, 89, 99 - \item element deletion, 94 - \item elif keyword, 41 - \item ellipses, 20 - \item else keyword, 41 - \item email address, 116 - \item embedded object, 148, 151, 167 - \subitem copying, 149 - \item emotional debugging, 6, 201 - \item empty list, 89 - \item empty string, 79, 95 - \item encapsulation, 32, 36, 54, 67, 75, 175 - \item encode, 169, 177 - \item encrypt, 169 - \item encryption, 112 - \item end of line character, 142 - \item Entry widget, 184 - \item enumerate function, 119 - \item epsilon, 67 - \item equality and assignment, 63 - \item equivalence, 96 - \item equivalent, 100 - \item error - \subitem compile-time, 195 - \subitem runtime, 3, 15, 44, 46, 195 - \subitem semantic, 4, 10, 15, 78, 195, 199 - \subitem shape, 122 - \subitem syntax, 3, 15, 195 - \item error checking, 58 - \item error message, 3, 4, 6, 10, 15, 195 - \item Euclid's algorithm, 62 - \item eval function, 69 - \item evaluate, 13 - \item event, 191 - \item event handler, 188 - \item event loop, 181, 191 - \item Event object, 188 - \item event string, 188 - \item event-driven programming, 182, 190, 191 - \item exception, 3, 7, 15, 195, 198 - \subitem AttributeError, 150, 199 - \subitem IndexError, 72, 78, 90, 199 - \subitem IOError, 138 - \subitem KeyError, 104, 199 - \subitem NameError, 23, 198 - \subitem OverflowError, 46 - \subitem RuntimeError, 44 - \subitem SyntaxError, 19 - \subitem TypeError, 71, 74, 108, 116, 117, 136, 161, 198 - \subitem UnboundLocalError, 111 - \subitem ValueError, 45, 107, 116 - \item exception, catching, 138 - \item executable, 2, 7 - \item exercise, secret, 143 - \item exists function, 137 - \item experimental debugging, 4, 133 - \item expression, 12, 13, 16 - \subitem big and hairy, 200 - \subitem boolean, 39, 46 - \item extend method, 92 - - \indexspace - - \item factorial function, 56, 58 - \item False special value, 39 - \item Fermat's Last Theorem, 47 - \item fibonacci function, 57, 109 - \item file, 135 - \subitem compression, 141 - \subitem permission, 138 - \subitem reading and writing, 135 - \item file object, 81, 86 - \item filename, 137 - \item filter pattern, 93, 100 - \item find function, 74 - \item flag, 110, 113 - \item float function, 17 - \item float type, 9 - \item floating-point, 15, 67 - \item floating-point division, 12 - \item floor division, 12, 16, 46 - \item flow of execution, 21, 26, 58, 59, 64, 177, 190, 198 - \item flower, 37 - \item folder, 137 - \item for loop, 30, 72, 91, 119 - \item formal language, 4, 8 - \item format operator, 136, 143, 198 - \item format sequence, 136, 143 - \item format string, 136, 143 - \item frabjous, 56 - \item frame, 23, 26, 43, 57, 109 - \item Frame widget, 186 - \item Free Documentation License, GNU, v, vi - \item frequency, 105 - \subitem letter, 123 - \subitem word, 125, 134 - \item fruitful function, 24, 26 - \item frustration, 201 - \item function, 19, 25, 159 - \subitem abs, 52 - \subitem ack, 61 - \subitem arc, 31 - \subitem choice, 126 - \subitem circle, 31 - \subitem cmp, 172 - \subitem compare, 52 - \subitem deepcopy, 150 - \subitem dict, 103 - \subitem enumerate, 119 - \subitem eval, 69 - \subitem exists, 137 - \subitem factorial, 56 - \subitem fibonacci, 57, 109 - \subitem find, 74 - \subitem float, 17 - \subitem getattr, 166 - \subitem getcwd, 137 - \subitem hasattr, 150, 166 - \subitem int, 17 - \subitem isinstance, 58, 164 - \subitem len, 26, 72, 104 - \subitem list, 95 - \subitem log, 18 - \subitem max, 117, 118 - \subitem min, 117, 118 - \subitem open, 81, 82, 135, 138, 139 - \subitem polygon, 31 - \subitem popen, 140 - \subitem randint, 100, 126 - \subitem random, 121, 126 - \subitem raw\_input, 45 - \subitem recursive, 43 - \subitem reload, 142, 196 - \subitem repr, 142 - \subitem reversed, 122 - \subitem shuffle, 174 - \subitem sorted, 122 - \subitem sqrt, 18, 53 - \subitem str, 18 - \subitem sum, 118 - \subitem tuple, 115 - \subitem type, 150 - \subitem zip, 118 - \item function argument, 21 - \item function call, 17, 26 - \item function composition, 54 - \item function definition, 19, 20, 25 - \item function frame, 23, 26, 43, 109 - \item function object, 20, 26 - \item function parameter, 21 - \item function syntax, 160 - \item function type - \subitem modifier, 155 - \subitem pure, 154 - \item function, fruitful, 24 - \item function, math, 18 - \item function, reasons for, 25 - \item function, trigonometric, 18 - \item function, tuple as return value, 117 - \item function, void, 24 - \item functional programming style, 155, 158 - - \indexspace - - \item gamma function, 58 - \item gather, 117, 123 - \item GCD (greatest common divisor), 61 - \item generalization, 32, 36, 83, 157 - \item geometry manager, 187, 191 - \item get method, 105 - \item getattr function, 166 - \item getcwd function, 137 - \item global statement, 110 - \item global variable, 110, 113 - \subitem update, 110 - \item GNU Free Documentation License, v, vi - \item graphical user interface, 181 - \item greatest common divisor (GCD), 61 - \item grid, 27 - \item guardian pattern, 59, 60, 77 - \item GUI, 181, 191 - \item Gui module, 181 - \item gunzip (Unix command), 141 - - \indexspace - - \item Hand class, 174 - \item hanging, 197 - \item HAS-A relationship, 176, 178 - \item hasattr function, 150, 166 - \item hash function, 108, 113 - \item hashable, 108, 113, 120 - \item hashtable, 104, 113 - \item header, 19, 25, 196 - \item Hello, World, 6 - \item help utility, 8 - \item hexadecimal, 146 - \item high-level language, 1, 7 - \item histogram, 105, 113 - \subitem random choice, 126, 129 - \subitem word frequencies, 127 - \item Holmes, Sherlock, 4 - \item homophone, 114 - \item HTMLParser module, 193 - \item hyperlink, 193 - \item hypotenuse, 54 - - \indexspace - - \item identical, 100 - \item identity, 96 - \item if statement, 40 - \item Image module, 192 - \item image viewer, 192 - \item IMDb (Internet Movie Database), 144 - \item immutability, 74, 79, 97, 108, 115, 122 - \item implementation, 105, 113, 132 - \item import statement, 26, 29, 142 - \item in operator, 76, 90, 104 - \item increment, 64, 68, 155, 161 - \item incremental development, 60, 195 - \item indentation, 19, 160, 196 - \item index, 71, 77, 79, 89, 99, 103, 198 - \subitem looping with, 84, 91 - \subitem negative, 72 - \subitem slice, 73, 92 - \subitem starting at zero, 71, 90 - \item IndexError, 72, 78, 90, 199 - \item infinite loop, 65, 69, 181, 197 - \item infinite recursion, 44, 47, 58, 197, 198 - \item inheritance, 174, 177 - \item init method, 162, 166, 170, 172, 174 - \item initialization - \subitem variable, 68 - \item initialization (before update), 64 - \item instance, 29, 36, 146, 151 - \subitem as argument, 147 - \subitem as return value, 148 - \item instance attribute, 146, 151, 170, 177 - \item instantiation, 146 - \item int function, 17 - \item int type, 9 - \item integer, 15 - \subitem long, 111 - \item interactive mode, 2, 7, 12, 24 - \item interface, 33, 35, 36, 177 - \item interlocking words, 101 - \item Internet Movie Database (IMDb), 144 - \item interpret, 1, 7 - \item invariant, 157, 158, 191 - \item invert dictionary, 107 - \item invocation, 75, 79 - \item IOError, 138 - \item is operator, 96, 149 - \item IS-A relationship, 176, 178 - \item isinstance function, 58, 164 - \item item, 79, 89 - \subitem Canvas, 183, 191 - \subitem dictionary, 112 - \item item assignment, 74, 90, 116 - \item item update, 91 - \item items method, 119 - \item iteration, 63, 64, 69 - - \indexspace - - \item join method, 95, 173 - - \indexspace - - \item Kangaroo class, 167 - \item Kevin Bacon Game, 144 - \item key, 103, 112 - \item key-value pair, 103, 112, 119 - \item keyboard input, 45 - \item KeyError, 104, 199 - \item keys method, 106 - \item keyword, 11, 15, 196 - \subitem def, 19 - \subitem elif, 41 - \subitem else, 41 - \item keyword argument, 33, 36, 121, 182, 191 - \item Koch curve, 48 - - \indexspace - - \item Label widget, 182 - \item language - \subitem formal, 4 - \subitem high-level, 1 - \subitem low-level, 1 - \subitem natural, 4 - \subitem programming, 1 - \subitem safe, 3 - \subitem Turing complete, 55 - \item leap of faith, 57 - \item len function, 26, 72, 104 - \item letter frequency, 123 - \item letter rotation, 80, 113 - \item Linux, 4 - \item lipogram, 82 - \item list, 89, 95, 99, 122 - \subitem as argument, 97 - \subitem comprehension, 94 - \subitem concatenation, 91, 98, 101 - \subitem copy, 92 - \subitem element, 89 - \subitem empty, 89 - \subitem function, 95 - \subitem index, 90 - \subitem membership, 90 - \subitem method, 92 - \subitem nested, 89, 91 - \subitem of objects, 172 - \subitem of tuples, 118 - \subitem operation, 91 - \subitem repetition, 91 - \subitem slice, 92 - \subitem traversal, 91, 100 - \item literalness, 5 - \item local variable, 22, 26 - \item log function, 18 - \item logarithm, 134 - \item logical operator, 39, 40 - \item long integer, 111 - \item lookup, 113 - \item lookup, dictionary, 106 - \item loop, 31, 36, 65, 118 - \subitem condition, 197 - \subitem event, 181 - \subitem for, 30, 72, 91 - \subitem infinite, 65, 181, 197 - \subitem nested, 172 - \subitem traversal, 72 - \subitem while, 64 - \item looping - \subitem with dictionaries, 106 - \subitem with indices, 84, 91 - \subitem with strings, 75 - \item looping and counting, 75 - \item low-level language, 1, 7 - \item ls (Unix command), 140 - - \indexspace - - \item map pattern, 93, 100 - \item map to, 169 - \item mapping, 90, 100, 131 - \item Markov analysis, 130 - \item mash-up, 131 - \item math function, 18 - \item max function, 117, 118 - \item McCloskey, Robert, 72 - \item MD5 algorithm, 143 - \item membership - \subitem binary search, 101 - \subitem bisection search, 101 - \subitem dictionary, 104 - \subitem list, 90 - \subitem set, 104 - \item memo, 109, 113 - \item mental model, 200 - \item Menubutton widget, 187 - \item metaphor, method invocation, 161 - \item metathesis, 124 - \item method, 75, 79, 159, 167 - \subitem \_\_cmp\_\_, 171 - \subitem \_\_str\_\_, 163, 172 - \subitem add, 163 - \subitem append, 92, 98, 172, 173 - \subitem close, 136, 139, 141 - \subitem config, 183 - \subitem count, 76 - \subitem extend, 92 - \subitem get, 105 - \subitem init, 162, 170, 172, 174 - \subitem items, 119 - \subitem join, 95, 173 - \subitem keys, 106 - \subitem mro, 177 - \subitem pop, 94, 173 - \subitem radd, 165 - \subitem read, 141 - \subitem readline, 81, 141 - \subitem remove, 94 - \subitem replace, 125 - \subitem setdefault, 109 - \subitem sort, 92, 99, 121, 174 - \subitem split, 95, 116 - \subitem string, 79 - \subitem strip, 82, 125 - \subitem translate, 125 - \subitem update, 119 - \subitem values, 104 - \subitem void, 93 - \item method append, 101 - \item method resolution order, 177 - \item method syntax, 160 - \item method, bound, 186 - \item method, list, 92 - \item min function, 117, 118 - \item model, mental, 200 - \item modifier, 155, 158 - \item module, 18, 26 - \subitem anydbm, 139 - \subitem bisect, 101 - \subitem copy, 149 - \subitem datetime, 158 - \subitem Gui, 181 - \subitem HTMLParser, 193 - \subitem Image, 192 - \subitem os, 137 - \subitem pickle, 135, 139 - \subitem pprint, 112 - \subitem profile, 132 - \subitem random, 100, 121, 126, 174 - \subitem reload, 142, 196 - \subitem shelve, 140, 144 - \subitem string, 125 - \subitem structshape, 122 - \subitem urllib, 143, 193 - \subitem Visual, 167 - \subitem vpython, 167 - \subitem World, 151 - \item module object, 18, 141 - \item module, writing, 141 - \item modulus operator, 39, 46 - \item Monty Python and the Holy Grail, 154 - \item MP3, 143 - \item mro method, 177 - \item multiline string, 35, 196 - \item multiple assignment, 63, 68, 110 - \item multiplicity (in class diagram), 176, 178 - \item mutability, 74, 90, 92, 97, 111, 115, 122, 148 - \item mutable object, as default value, 167 - - \indexspace - - \item NameError, 23, 198 - \item natural language, 4, 8 - \item negative index, 72 - \item nested conditional, 42, 47 - \item nested list, 89, 91, 100 - \item newline, 45, 63, 173 - \item Newton's method, 66 - \item None special value, 24, 52, 60, 93, 94 - \item not operator, 40 - \item number, random, 126 - - \indexspace - - \item object, 74, 79, 95, 96, 100, 145 - \subitem Callable, 188 - \subitem Canvas, 151 - \subitem class, 146 - \subitem copying, 149 - \subitem embedded, 148, 151, 167 - \subitem Event, 188 - \subitem file, 81, 86 - \subitem function, 20, 26 - \subitem module, 141 - \subitem mutable, 148 - \subitem printing, 160 - \item object code, 2, 7 - \item object diagram, 146, 148, 150, 151, 153, 171 - \item object-oriented language, 166 - \item object-oriented programming, 159, 167, 174 - \item octal, 11 - \item odometer, 86 - \item open function, 81, 82, 135, 138, 139 - \item operand, 12, 16 - \item operator, 16 - \subitem and, 40 - \subitem bitwise, 12 - \subitem boolean, 76 - \subitem bracket, 71, 89, 116 - \subitem del, 94 - \subitem format, 136, 143, 198 - \subitem in, 76, 90, 104 - \subitem is, 96, 149 - \subitem logical, 39, 40 - \subitem modulus, 39, 46 - \subitem not, 40 - \subitem or, 40 - \subitem overloading, 167 - \subitem relational, 40, 171 - \subitem slice, 73, 79, 92, 98, 116 - \subitem string, 14 - \subitem update, 93 - \item operator overloading, 164, 171 - \item operator, arithmetic, 12 - \item option, 182, 191 - \item optional argument, 76, 95, 107 - \item optional parameter, 128, 162 - \item or operator, 40 - \item order of operations, 13, 15, 201 - \item os module, 137 - \item other (parameter name), 162 - \item OverflowError, 46 - \item overloading, 167 - \item override, 129, 134, 162, 171, 174, 177 - - \indexspace - - \item packing widgets, 186, 191 - \item palindrome, 61, 79, 84, 86 - \item parameter, 21, 23, 25, 97 - \subitem gather, 117 - \subitem optional, 128, 162 - \subitem other, 162 - \subitem self, 161 - \item parent class, 174, 177 - \item parentheses - \subitem argument in, 17 - \subitem empty, 19, 75 - \subitem matching, 3 - \subitem overriding precedence, 13 - \subitem parameters in, 22 - \subitem parent class in, 174 - \subitem tuples in, 115 - \item parse, 5, 8, 144 - \item pass statement, 41 - \item path, 137, 143 - \subitem absolute, 137 - \subitem relative, 137 - \item pattern - \subitem decorate-sort-undecorate, 121 - \subitem DSU, 121, 128 - \subitem filter, 93, 100 - \subitem guardian, 59, 60, 77 - \subitem map, 93, 100 - \subitem reduce, 93, 100 - \subitem search, 75, 79, 83, 107 - \subitem swap, 116 - \item pdb (Python debugger), 199 - \item PEMDAS, 13 - \item permission, file, 138 - \item persistence, 135, 143 - \item pi, 18, 69 - \item pickle module, 135, 139 - \item pickling, 139 - \item pie, 37 - \item PIL (Python Imaging Library), 192 - \item pipe, 140, 143 - \item pixel coordinate, 190 - \item plain text, 81, 125, 144, 193 - \item planned development, 156, 158 - \item playing card, Anglo-American, 169 - \item poetry, 5 - \item Point class, 145, 163 - \item point, mathematical, 145 - \item poker, 169, 178 - \item polygon function, 31 - \item polymorphism, 166, 167, 176 - \item pop method, 94, 173 - \item popen function, 140 - \item portability, 1, 7 - \item postcondition, 36, 59, 177 - \item pprint module, 112 - \item precedence, 16, 201 - \item precondition, 36, 59, 100, 177 - \item prefix, 131 - \item pretty print, 112 - \item print statement, 6, 8, 163, 199 - \item problem recognition, 84--86 - \item problem solving, 1, 7 - \item profile module, 132 - \item program, 2, 7 - \item program testing, 85 - \item programming language, 1 - \item Project Gutenberg, 125 - \item prompt, 2, 7, 45 - \item prose, 5 - \item prototype and patch, 154, 156, 158 - \item pseudorandom, 126, 133 - \item pure function, 154, 158 - \item Puzzler, 86, 113, 124 - \item Pythagorean theorem, 52 - \item Python 3.0, 6, 12, 45, 111, 118 - \item Python debugger (pdb), 199 - \item Python Imaging Library (PIL), 192 - \item python.org, 8 - - \indexspace - - \item quotation mark, 6, 9, 35, 74, 196 - - \indexspace - - \item radd method, 165 - \item radian, 18 - \item rage, 201 - \item raise statement, 107, 157 - \item Ramanujan, Srinivasa, 69 - \item randint function, 100, 126 - \item random function, 121, 126 - \item random module, 100, 121, 126, 174 - \item random number, 126 - \item random text, 131 - \item random walk programming, 133, 201 - \item rank, 169 - \item raw\_input function, 45 - \item read method, 141 - \item readline method, 81, 141 - \item Rectangle class, 147 - \item recursion, 42, 43, 47, 55, 57 - \subitem base case, 44 - \subitem infinite, 44, 58, 198 - \item recursive definition, 56, 124 - \item reduce pattern, 93, 100 - \item reducible word, 114, 124 - \item redundancy, 5 - \item refactoring, 34 - \item reference, 97, 100 - \subitem aliasing, 96 - \item relational operator, 40, 171 - \item relative path, 137, 143 - \item reload function, 142, 196 - \item remove method, 94 - \item repetition, 30 - \subitem list, 91 - \item replace method, 125 - \item repr function, 142 - \item representation, 145, 147, 169 - \item return statement, 43, 51, 201 - \item return value, 17, 26, 51, 148 - \subitem tuple, 117 - \item reverse lookup, dictionary, 106, 113 - \item reverse word pair, 101 - \item reversed function, 122 - \item rotation - \subitem letters, 113 - \item rotation, letter, 80 - \item RSA algorithm, 112 - \item rules of precedence, 13, 16 - \item running pace, 8, 16, 158 - \item runtime error, 3, 15, 44, 46, 195, 198 - \item RuntimeError, 44, 58 - - \indexspace - - \item safe language, 3 - \item sanity check, 112 - \item scaffolding, 53, 60, 112 - \item scatter, 117, 123 - \item Scrabble, 124 - \item script, 2, 7 - \item script mode, 2, 7, 12, 24 - \item search, 107 - \item search pattern, 75, 79, 83 - \item search, binary, 101 - \item search, bisection, 101 - \item secret exercise, 143 - \item self (parameter name), 161 - \item semantic error, 4, 8, 10, 15, 78, 195, 199 - \item semantics, 4, 8, 159 - \item sequence, 71, 79, 89, 95, 115, 121 - \subitem coordinate, 184 - \item set, 129 - \subitem anagram, 123, 140 - \item set membership, 104 - \item setdefault method, 109 - \item sexagesimal, 156 - \item shallow copy, 150, 151 - \item shape, 123 - \item shape error, 122 - \item shell, 140 - \item shelve module, 140, 144 - \item shuffle function, 174 - \item SimpleTurtleWorld class, 186 - \item sine function, 18 - \item singleton, 108, 113, 115 - \item slice, 79 - \subitem copy, 74, 92 - \subitem list, 92 - \subitem string, 73 - \subitem tuple, 116 - \subitem update, 92 - \item slice operator, 73, 79, 92, 98, 116 - \item sort method, 92, 99, 121, 174 - \item sorted function, 122 - \item source code, 2, 7 - \item special case, 85, 86, 155 - \item special value - \subitem False, 39 - \subitem None, 24, 52, 60, 93, 94 - \subitem True, 39 - \item split method, 95, 116 - \item sqrt, 53 - \item sqrt function, 18 - \item square root, 66 - \item squiggly bracket, 103 - \item stack diagram, 23, 26, 36, 43, 56, 60, 97 - \item state diagram, 10, 15, 63, 78, 90, 96, 97, 108, 120, 146, 148, - 150, 153, 171 - \item statement, 12, 15 - \subitem assert, 157 - \subitem assignment, 10, 63 - \subitem break, 65 - \subitem compound, 40 - \subitem conditional, 40, 47, 55 - \subitem for, 30, 72, 91 - \subitem global, 110 - \subitem if, 40 - \subitem import, 26, 29, 142 - \subitem pass, 41 - \subitem print, 6, 8, 163, 199 - \subitem raise, 107, 157 - \subitem return, 43, 51, 201 - \subitem try, 138 - \subitem while, 64 - \item step size, 79 - \item str function, 18 - \item \_\_str\_\_ method, 163, 172 - \item string, 9, 15, 95, 122 - \subitem accumulator, 173 - \subitem comparison, 77 - \subitem empty, 95 - \subitem immutable, 74 - \subitem method, 75 - \subitem multiline, 35, 196 - \subitem operation, 14 - \subitem slice, 73 - \subitem triple-quoted, 35 - \item string method, 79 - \item string module, 125 - \item string representation, 142, 163 - \item string type, 9 - \item strip method, 82, 125 - \item structshape module, 122 - \item structure, 5 - \item subclass, 174 - \item subject, 160, 167, 186 - \item subtraction - \subitem dictionary, 129 - \subitem with borrowing, 68 - \item subtraction with borrowing, 157 - \item suffix, 131 - \item suit, 169 - \item sum function, 118 - \item superclass, 174 - \item superstitious debugging, 201 - \item SVG, 193 - \item Swampy, 29, 81, 151, 179, 181 - \item swap pattern, 116 - \item syntax, 3, 7, 159, 196 - \item syntax error, 3, 7, 15, 195 - \item SyntaxError, 19 - - \indexspace - - \item Tagger, 179 - \item temporary variable, 51, 60, 201 - \item test case, minimal, 199 - \item testing - \subitem and absence of bugs, 85 - \subitem incremental development, 52 - \subitem interactive mode, 2 - \subitem is hard, 85 - \subitem knowing the answer, 53 - \subitem leap of faith, 57 - \subitem minimal test case, 199 - \item text - \subitem plain, 81, 125, 144, 193 - \subitem random, 131 - \item text file, 143 - \item Text widget, 184 - \item Time class, 153 - \item Tkinter, 181 - \item token, 5, 8 - \item traceback, 24, 26, 44, 45, 107, 198 - \item translate method, 125 - \item traversal, 72, 75, 77, 79, 83, 93, 100, 105, 106, 118, 119, 121, - 127 - \subitem dictionary, 166 - \subitem list, 91 - \item traverse - \subitem dictionary, 119 - \item triangle, 47 - \item trigonometric function, 18 - \item triple-quoted string, 35 - \item True special value, 39 - \item try statement, 138 - \item tuple, 115, 117, 122, 123 - \subitem as key in dictionary, 120, 132 - \subitem assignment, 116 - \subitem comparison, 121, 172 - \subitem in brackets, 120 - \subitem singleton, 115 - \subitem slice, 116 - \item tuple assignment, 117, 118, 123 - \item tuple function, 115 - \item Turing complete language, 55 - \item Turing Thesis, 55 - \item Turing, Alan, 55 - \item turtle typewriter, 37 - \item TurtleWorld, 29, 48, 179 - \item type, 9, 15 - \subitem bool, 39 - \subitem dict, 103 - \subitem file, 135 - \subitem float, 9 - \subitem int, 9 - \subitem list, 89 - \subitem long, 111 - \subitem set, 129 - \subitem str, 9 - \subitem tuple, 115 - \subitem user-defined, 145, 153 - \item type checking, 58 - \item type conversion, 17 - \item type function, 150 - \item type-based dispatch, 164, 165, 167 - \item TypeError, 71, 74, 108, 116, 117, 136, 161, 198 - \item typewriter, turtle, 37 - \item typographical error, 133 - - \indexspace - - \item UML, 176 - \item UnboundLocalError, 111 - \item underscore character, 11 - \item uniqueness, 101 - \item Unix command - \subitem gunzip, 141 - \subitem ls, 140 - \item update, 64, 66, 68 - \subitem coordinate, 189 - \subitem database, 139 - \subitem global variable, 110 - \subitem histogram, 127 - \subitem item, 91 - \subitem slice, 92 - \item update method, 119 - \item update operator, 93 - \item URL, 143, 193 - \item urllib module, 143, 193 - \item use before def, 15, 21 - \item user-defined type, 145, 153 - - \indexspace - - \item value, 9, 15, 95, 96, 112 - \subitem default, 128 - \subitem tuple, 117 - \item ValueError, 45, 107, 116 - \item values method, 104 - \item variable, 10, 15 - \subitem global, 110 - \subitem local, 22 - \subitem temporary, 51, 60, 201 - \subitem updating, 64 - \item variable-length argument tuple, 117 - \item vector graphics, 193 - \item veneer, 173, 177 - \item Visual module, 167 - \item void function, 24, 26 - \item void method, 93 - \item vpython module, 167 - - \indexspace - - \item walk, directory, 138 - \item while loop, 64 - \item whitespace, 25, 46, 82, 142, 196 - \item widget, 181, 191 - \subitem Button, 182 - \subitem Canvas, 183 - \subitem Entry, 184 - \subitem Frame, 186 - \subitem Label, 182 - \subitem Menubutton, 187 - \subitem Text, 184 - \item widget, packing, 186 - \item word count, 141 - \item word frequency, 125, 134 - \item word, reducible, 114, 124 - \item working directory, 137 - \item World module, 151 - \item worst bug, 167 - \subitem ever, 192 - - \indexspace - - \item zero, index starting at, 71, 90 - \item zip function, 118 - \subitem use with dict, 119 - \item Zipf's law, 134 - -\end{theindex} diff --git a/thinkpython/tex/book.log b/thinkpython/tex/book.log deleted file mode 100644 index 1b808ae..0000000 --- a/thinkpython/tex/book.log +++ /dev/null @@ -1,714 +0,0 @@ -This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=latex 2010.10.11) 11 OCT 2010 21:52 -entering extended mode - restricted \write18 enabled. - %&-line parsing enabled. -**book -(./book.tex -LaTeX2e <2009/09/24> -Babel and hyphenation patterns for english, usenglishmax, dumylang, noh -yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov -ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1 -9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san -skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn -orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian -, estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po -rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded. -(/usr/share/texmf-texlive/tex/latex/base/book.cls -Document Class: book 2007/10/19 v1.4h Standard LaTeX document class -(/usr/share/texmf-texlive/tex/latex/base/bk10.clo -File: bk10.clo 2007/10/19 v1.4h Standard LaTeX file (size option) -) -\c@part=\count79 -\c@chapter=\count80 -\c@section=\count81 -\c@subsection=\count82 -\c@subsubsection=\count83 -\c@paragraph=\count84 -\c@subparagraph=\count85 -\c@figure=\count86 -\c@table=\count87 -\abovecaptionskip=\skip41 -\belowcaptionskip=\skip42 -\bibindent=\dimen102 -) -(/usr/share/texmf-texlive/tex/latex/geometry/geometry.sty -Package: geometry 2008/12/21 v4.2 Page Geometry - -(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty -Package: keyval 1999/03/16 v1.13 key=value parser (DPC) -\KV@toks@=\toks14 -) -(/usr/share/texmf-texlive/tex/generic/oberdiek/ifpdf.sty -Package: ifpdf 2009/04/10 v2.0 Provides the ifpdf switch (HO) -Package ifpdf Info: pdfTeX in pdf mode not detected. -) -(/usr/share/texmf-texlive/tex/generic/oberdiek/ifvtex.sty -Package: ifvtex 2008/11/04 v1.4 Switches for detecting VTeX and its modes (HO) -Package ifvtex Info: VTeX not detected. -) -\Gm@cnth=\count88 -\Gm@cntv=\count89 -\c@Gm@tempcnt=\count90 -\Gm@bindingoffset=\dimen103 -\Gm@wd@mp=\dimen104 -\Gm@odd@mp=\dimen105 -\Gm@even@mp=\dimen106 -\Gm@dimlist=\toks15 - -(/usr/share/texmf-texlive/tex/xelatex/xetexconfig/geometry.cfg)) -(/usr/share/texmf-texlive/tex/latex/pslatex/pslatex.sty -Package: pslatex 1996/07/24 v1.2 pslatex emulation (DPC) -LaTeX Font Info: Redeclaring symbol font `operators' on input line 65. -LaTeX Font Info: Overwriting symbol font `operators' in version `normal' -(Font) OT1/cmr/m/n --> OT1/ptmcm/m/n on input line 65. -LaTeX Font Info: Overwriting symbol font `operators' in version `bold' -(Font) OT1/cmr/bx/n --> OT1/ptmcm/m/n on input line 65. -LaTeX Font Info: Redeclaring symbol font `letters' on input line 66. -LaTeX Font Info: Overwriting symbol font `letters' in version `normal' -(Font) OML/cmm/m/it --> OML/ptmcm/m/it on input line 66. -LaTeX Font Info: Overwriting symbol font `letters' in version `bold' -(Font) OML/cmm/b/it --> OML/ptmcm/m/it on input line 66. -LaTeX Font Info: Redeclaring symbol font `symbols' on input line 67. -LaTeX Font Info: Overwriting symbol font `symbols' in version `normal' -(Font) OMS/cmsy/m/n --> OMS/pzccm/m/n on input line 67. -LaTeX Font Info: Overwriting symbol font `symbols' in version `bold' -(Font) OMS/cmsy/b/n --> OMS/pzccm/m/n on input line 67. -LaTeX Font Info: Redeclaring symbol font `largesymbols' on input line 68. -LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal' -(Font) OMX/cmex/m/n --> OMX/psycm/m/n on input line 68. -LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold' -(Font) OMX/cmex/m/n --> OMX/psycm/m/n on input line 68. -\symbold=\mathgroup4 -\symitalic=\mathgroup5 -LaTeX Font Info: Redeclaring math alphabet \mathbf on input line 74. -LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' -(Font) OT1/cmr/bx/n --> OT1/ptm/bx/n on input line 74. -LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold' -(Font) OT1/cmr/bx/n --> OT1/ptm/bx/n on input line 74. -LaTeX Font Info: Redeclaring math alphabet \mathit on input line 75. -LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' -(Font) OT1/cmr/m/it --> OT1/ptm/m/it on input line 75. -LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' -(Font) OT1/cmr/bx/it --> OT1/ptm/m/it on input line 75. -) -(/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty -\Urlmuskip=\muskip10 -Package: url 2006/04/12 ver 3.3 Verb mode for urls, etc. -) -(/usr/share/texmf-texlive/tex/latex/fancyhdr/fancyhdr.sty -\fancy@headwidth=\skip43 -\f@ncyO@elh=\skip44 -\f@ncyO@erh=\skip45 -\f@ncyO@olh=\skip46 -\f@ncyO@orh=\skip47 -\f@ncyO@elf=\skip48 -\f@ncyO@erf=\skip49 -\f@ncyO@olf=\skip50 -\f@ncyO@orf=\skip51 -) -(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty -Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) - -(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty -Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR) - -(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty -Package: trig 1999/03/16 v1.09 sin cos tan (DPC) -) -(/etc/texmf/tex/latex/config/graphics.cfg -File: graphics.cfg 2009/08/28 v1.8 graphics configuration of TeX Live -) -Package graphics Info: Driver file: dvips.def on input line 91. - -(/usr/share/texmf-texlive/tex/latex/graphics/dvips.def -File: dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR) -)) -\Gin@req@height=\dimen107 -\Gin@req@width=\dimen108 -) -(/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty -Package: amsmath 2000/07/18 v2.13 AMS math features -\@mathmargin=\skip52 - -For additional information on amsmath, use the `?' option. -(/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty -Package: amstext 2000/06/29 v2.01 - -(/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty -File: amsgen.sty 1999/11/30 v2.0 -\@emptytoks=\toks16 -\ex@=\dimen109 -)) -(/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty -Package: amsbsy 1999/11/29 v1.2d -\pmbraise@=\dimen110 -) -(/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty -Package: amsopn 1999/12/14 v2.01 operator names -) -\inf@bad=\count91 -LaTeX Info: Redefining \frac on input line 211. -\uproot@=\count92 -\leftroot@=\count93 -LaTeX Info: Redefining \overline on input line 307. -\classnum@=\count94 -\DOTSCASE@=\count95 -LaTeX Info: Redefining \ldots on input line 379. -LaTeX Info: Redefining \dots on input line 382. -LaTeX Info: Redefining \cdots on input line 467. -\Mathstrutbox@=\box26 -\strutbox@=\box27 -\big@size=\dimen111 -LaTeX Font Info: Redeclaring font encoding OML on input line 567. -LaTeX Font Info: Redeclaring font encoding OMS on input line 568. -\macc@depth=\count96 -\c@MaxMatrixCols=\count97 -\dotsspace@=\muskip11 -\c@parentequation=\count98 -\dspbrk@lvl=\count99 -\tag@help=\toks17 -\row@=\count100 -\column@=\count101 -\maxfields@=\count102 -\andhelp@=\toks18 -\eqnshift@=\dimen112 -\alignsep@=\dimen113 -\tagshift@=\dimen114 -\tagwidth@=\dimen115 -\totwidth@=\dimen116 -\lineht@=\dimen117 -\@envbody=\toks19 -\multlinegap=\skip53 -\multlinetaggap=\skip54 -\mathdisplay@stack=\toks20 -LaTeX Info: Redefining \[ on input line 2666. -LaTeX Info: Redefining \] on input line 2667. -) -(/usr/share/texmf-texlive/tex/latex/amscls/amsthm.sty -Package: amsthm 2004/08/06 v2.20 -\thm@style=\toks21 -\thm@bodyfont=\toks22 -\thm@headfont=\toks23 -\thm@notefont=\toks24 -\thm@headpunct=\toks25 -\thm@preskip=\skip55 -\thm@postskip=\skip56 -\thm@headsep=\skip57 -\dth@everypar=\toks26 -) -(/usr/share/texmf-texlive/tex/latex/amsfonts/amssymb.sty -Package: amssymb 2009/06/22 v3.00 - -(/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty -Package: amsfonts 2009/06/22 v3.00 Basic AMSFonts support -\symAMSa=\mathgroup6 -\symAMSb=\mathgroup7 -LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold' -(Font) U/euf/m/n --> U/euf/b/n on input line 96. -)) -(/usr/share/texmf-texlive/tex/latex/exercise/exercise.sty -Package: exercise 2009/03/26 v1.3 Exercise package (P.Pichaureau) - -(/usr/share/texmf-texlive/tex/latex/base/ifthen.sty -Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC) -) -\Exesep=\skip58 -\Exetopsep=\skip59 -\Exeparsep=\skip60 -\Exepartopsep=\skip61 -\Exeleftmargin=\skip62 -\Exerightmargin=\skip63 -\Exelabelwidth=\skip64 -\Exelabelsep=\skip65 -\ExerciseBefore=\skip66 -\QuestionBefore=\skip67 -\subQuestionBefore=\skip68 -\subsubQuestionBefore=\skip69 -\QuestionIndent=\skip70 -\subQuestionIndent=\skip71 -\subsubQuestionIndent=\skip72 -\c@Exercise=\count103 -\c@ExePart=\count104 -\c@Question=\count105 -\c@subQuestion=\count106 -\c@subsubQuestion=\count107 -\c@savedQuestion=\count108 -\c@savedsubQuestion=\count109 -\c@savedsubsubQuestion=\count110 -\@QuestionLevel=\count111 -\@Exercisebox=\box28 -\all@Exercisebox=\box29 -\temp@Exercisebox=\box30 -\all@Answerbox=\box31 -\temp@Answerbox=\box32 -\ExerciseDifficulty=\count112 -\QuestionDifficulty=\count113 -\subQuestionDifficulty=\count114 -\subsubQuestionDifficulty=\count115 -\ExePartDifficulty=\count116 -\@Answerbox=\box33 -\colonnesLevel=\count117 -\tempskipa=\skip73 -\tempskipb=\skip74 -\@savedmathindent=\skip75 -) -(/usr/share/texmf-texlive/tex/latex/base/makeidx.sty -Package: makeidx 2000/03/29 v1.0m Standard LaTeX package -) -(/usr/share/texmf-texlive/tex/latex/setspace/setspace.sty -Package: setspace 2000/12/01 6.7 Contributed and Supported LaTeX2e package - -Package: `setspace' 6.7 <2000/12/01> -) (/usr/share/texmf/tex/latex/misc/hevea.sty -Package: hevea 2002/01/11 - -(/usr/share/texmf-texlive/tex/latex/comment/comment.sty -\CommentStream=\write3 - -Excluding comment 'comment') -\c@cuttingdepth=\count118 - Excluding comment 'rawhtml' -Excluding comment 'htmlonly' -\@bgcolorbin=\box34 -) -(/usr/share/texmf-texlive/tex/latex/upquote/upquote.sty -Package: upquote 2003/08/11 v1.1 Covington's upright-quote modification to verb -atim and verb - -(/usr/share/texmf-texlive/tex/latex/base/textcomp.sty -Package: textcomp 2005/09/27 v1.99g Standard LaTeX package -Package textcomp Info: Sub-encoding information: -(textcomp) 5 = only ISO-Adobe without \textcurrency -(textcomp) 4 = 5 + \texteuro -(textcomp) 3 = 4 + \textohm -(textcomp) 2 = 3 + \textestimated + \textcurrency -(textcomp) 1 = TS1 - \textcircled - \t -(textcomp) 0 = TS1 (full) -(textcomp) Font families with sub-encoding setting implement -(textcomp) only a restricted character set as indicated. -(textcomp) Family '?' is the default used for unknown fonts. -(textcomp) See the documentation for details. -Package textcomp Info: Setting ? sub-encoding to TS1/1 on input line 71. - -(/usr/share/texmf-texlive/tex/latex/base/ts1enc.def -File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file -) -LaTeX Info: Redefining \oldstylenums on input line 266. -Package textcomp Info: Setting cmr sub-encoding to TS1/0 on input line 281. -Package textcomp Info: Setting cmss sub-encoding to TS1/0 on input line 282. -Package textcomp Info: Setting cmtt sub-encoding to TS1/0 on input line 283. -Package textcomp Info: Setting cmvtt sub-encoding to TS1/0 on input line 284. -Package textcomp Info: Setting cmbr sub-encoding to TS1/0 on input line 285. -Package textcomp Info: Setting cmtl sub-encoding to TS1/0 on input line 286. -Package textcomp Info: Setting ccr sub-encoding to TS1/0 on input line 287. -Package textcomp Info: Setting ptm sub-encoding to TS1/4 on input line 288. -Package textcomp Info: Setting pcr sub-encoding to TS1/4 on input line 289. -Package textcomp Info: Setting phv sub-encoding to TS1/4 on input line 290. -Package textcomp Info: Setting ppl sub-encoding to TS1/3 on input line 291. -Package textcomp Info: Setting pag sub-encoding to TS1/4 on input line 292. -Package textcomp Info: Setting pbk sub-encoding to TS1/4 on input line 293. -Package textcomp Info: Setting pnc sub-encoding to TS1/4 on input line 294. -Package textcomp Info: Setting pzc sub-encoding to TS1/4 on input line 295. -Package textcomp Info: Setting bch sub-encoding to TS1/4 on input line 296. -Package textcomp Info: Setting put sub-encoding to TS1/5 on input line 297. -Package textcomp Info: Setting uag sub-encoding to TS1/5 on input line 298. -Package textcomp Info: Setting ugq sub-encoding to TS1/5 on input line 299. -Package textcomp Info: Setting ul8 sub-encoding to TS1/4 on input line 300. -Package textcomp Info: Setting ul9 sub-encoding to TS1/4 on input line 301. -Package textcomp Info: Setting augie sub-encoding to TS1/5 on input line 302. -Package textcomp Info: Setting dayrom sub-encoding to TS1/3 on input line 303. -Package textcomp Info: Setting dayroms sub-encoding to TS1/3 on input line 304. - -Package textcomp Info: Setting pxr sub-encoding to TS1/0 on input line 305. -Package textcomp Info: Setting pxss sub-encoding to TS1/0 on input line 306. -Package textcomp Info: Setting pxtt sub-encoding to TS1/0 on input line 307. -Package textcomp Info: Setting txr sub-encoding to TS1/0 on input line 308. -Package textcomp Info: Setting txss sub-encoding to TS1/0 on input line 309. -Package textcomp Info: Setting txtt sub-encoding to TS1/0 on input line 310. -Package textcomp Info: Setting futs sub-encoding to TS1/4 on input line 311. -Package textcomp Info: Setting futx sub-encoding to TS1/4 on input line 312. -Package textcomp Info: Setting futj sub-encoding to TS1/4 on input line 313. -Package textcomp Info: Setting hlh sub-encoding to TS1/3 on input line 314. -Package textcomp Info: Setting hls sub-encoding to TS1/3 on input line 315. -Package textcomp Info: Setting hlst sub-encoding to TS1/3 on input line 316. -Package textcomp Info: Setting hlct sub-encoding to TS1/5 on input line 317. -Package textcomp Info: Setting hlx sub-encoding to TS1/5 on input line 318. -Package textcomp Info: Setting hlce sub-encoding to TS1/5 on input line 319. -Package textcomp Info: Setting hlcn sub-encoding to TS1/5 on input line 320. -Package textcomp Info: Setting hlcw sub-encoding to TS1/5 on input line 321. -Package textcomp Info: Setting hlcf sub-encoding to TS1/5 on input line 322. -Package textcomp Info: Setting pplx sub-encoding to TS1/3 on input line 323. -Package textcomp Info: Setting pplj sub-encoding to TS1/3 on input line 324. -Package textcomp Info: Setting ptmx sub-encoding to TS1/4 on input line 325. -Package textcomp Info: Setting ptmj sub-encoding to TS1/4 on input line 326. -)) -\@indexfile=\write4 -\openout4 = `book.idx'. - - -Writing index file book.idx -(./book.aux) -\openout1 = `book.aux'. - -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 52. -LaTeX Font Info: ... okay on input line 52. -LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 52. -LaTeX Font Info: ... okay on input line 52. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 52. -LaTeX Font Info: ... okay on input line 52. -LaTeX Font Info: Checking defaults for OMS/pzccm/m/n on input line 52. -LaTeX Font Info: Try loading font information for OMS+pzccm on input line 52 -. - (/usr/share/texmf-texlive/tex/latex/psnfss/omspzccm.fd -File: omspzccm.fd 2000/01/03 Fontinst v1.801 font definitions for OMS/pzccm. -) -LaTeX Font Info: ... okay on input line 52. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 52. -LaTeX Font Info: ... okay on input line 52. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 52. -LaTeX Font Info: ... okay on input line 52. -LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 52. -LaTeX Font Info: Try loading font information for TS1+cmr on input line 52. - -(/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd -File: ts1cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions -) -LaTeX Font Info: ... okay on input line 52. - -*geometry auto-detecting driver* -*geometry detected driver: dvips* --------------------- Geometry parameters -paper: class default -landscape: -- -twocolumn: -- -twoside: true -asymmetric: -- -h-parts: 130.086pt, 397.48499pt, 86.72401pt -v-parts: 90.3375pt, 614.295pt, 90.3375pt -hmarginratio: 3:2 -vmarginratio: 1:1 -lines: -- -heightrounded: -- -bindingoffset: 0.0pt -truedimen: -- -includehead: -- -includefoot: -- -includemp: -- -driver: dvips --------------------- Page layout dimensions and switches -\paperwidth 614.295pt -\paperheight 794.96999pt -\textwidth 397.48499pt -\textheight 614.295pt -\oddsidemargin 57.81601pt -\evensidemargin 14.45403pt -\topmargin -11.99998pt -\headheight 12.0pt -\headsep 18.06749pt -\footskip 25.29494pt -\marginparwidth 125.0pt -\marginparsep 7.0pt -\columnsep 10.0pt -\skip\footins 9.0pt plus 4.0pt minus 2.0pt -\hoffset 0.0pt -\voffset 0.0pt -\mag 1000 -\@twosidetrue \@mparswitchtrue -(1in=72.27pt, 1cm=28.45pt) ------------------------ -(./latexonly) -\c@ex=\count119 - [1 - - -] [2] [3] -LaTeX Font Info: Try loading font information for TS1+ptm on input line 140. - - (/usr/share/texmf-texlive/tex/latex/psnfss/ts1ptm.fd -File: ts1ptm.fd 2001/06/04 font definitions for TS1/ptm. -) -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <9> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 147. -LaTeX Font Info: Try loading font information for OT1+ptmcm on input line 17 -6. -(/usr/share/texmf-texlive/tex/latex/psnfss/ot1ptmcm.fd -File: ot1ptmcm.fd 2000/01/03 Fontinst v1.801 font definitions for OT1/ptmcm. -) -LaTeX Font Info: Try loading font information for OML+ptmcm on input line 17 -6. - -(/usr/share/texmf-texlive/tex/latex/psnfss/omlptmcm.fd -File: omlptmcm.fd 2000/01/03 Fontinst v1.801 font definitions for OML/ptmcm. -) -LaTeX Font Info: Try loading font information for OMX+psycm on input line 17 -6. - -(/usr/share/texmf-texlive/tex/latex/psnfss/omxpsycm.fd -File: omxpsycm.fd 2000/01/03 Fontinst v1.801 font definitions for OMX/psycm. -) -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <7> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 176. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <5> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 176. -LaTeX Font Info: Try loading font information for U+msa on input line 176. - -(/usr/share/texmf-texlive/tex/latex/amsfonts/umsa.fd -File: umsa.fd 2009/06/22 v3.00 AMS symbols A -) -LaTeX Font Info: Try loading font information for U+msb on input line 176. - -(/usr/share/texmf-texlive/tex/latex/amsfonts/umsb.fd -File: umsb.fd 2009/06/22 v3.00 AMS symbols B -) [4] -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <24.88> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 207. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <14.4> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 209. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <10> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 270. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <7.4> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 270. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <6> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 270. - [5 - -] -Underfull \hbox (badness 10000) in paragraph at lines 320--322 - - [] - -[6] [7] [8] [9] [10] (./book.toc [11 - - -] [12] [13] [14] [15] [16] [17] [18]) -\tf@toc=\write5 -\openout5 = `book.toc'. - - -[19] [20 - -] -Chapter 1. -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <20.74> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 703. -[1 - - -] -File: figs/interpret.eps Graphic file (type eps) - -File: figs/compile.eps Graphic file (type eps) - [2] -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <12> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 890. - [3] [4] -LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <8> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 1083. - [5] -LaTeX Font Info: Try loading font information for TS1+pcr on input line 1136 -. - -(/usr/share/texmf-texlive/tex/latex/psnfss/ts1pcr.fd -File: ts1pcr.fd 2001/06/04 font definitions for TS1/pcr. -) [6] [7] [8] -Chapter 2. -[9 - -] -File: figs/state2.eps Graphic file (type eps) - [10] [11] [12] [13] [14] [15] [16] -Chapter 3. -[17 - -] [18] [19] [20] [21] [22] -File: figs/stack.eps Graphic file (type eps) - [23] [24] [25] [26] [27] -[28] -Chapter 4. -[29 - -] [30] -Underfull \hbox (badness 1163) in paragraph at lines 3386--3388 -[]\OT1/ptm/m/n/10 Hint: fig-ure out the cir-cum-fer-ence of the cir-cle and mak -e sure that \OT1/pcr/m/n/10 length * n = - [] - -[31] [32] [33] [34] [35] -File: figs/flowers.eps Graphic file (type eps) - [36] -File: figs/pies.eps Graphic file (type eps) - [37] [38 - -] -Chapter 5. -[39] [40] [41] [42] -File: figs/stack2.eps Graphic file (type eps) - [43] -LaTeX Font Info: Font shape `OT1/phv/m/n' will be -(Font) scaled to size 8.99994pt on input line 4430. - [44] [45] [46] [47] -File: figs/koch.eps Graphic file (type eps) - -[48] [49] [50 - -] -Chapter 6. -[51] [52] [53] [54] [55] -File: figs/stack3.eps Graphic file (type eps) - [56] [57] [58] [59] [60] [61] -[62] -Chapter 7. -File: figs/assign2.eps Graphic file (type eps) - [63 - -] [64] [65] [66] [67] [68] [69] [70] -Chapter 8. -[71 - -] [72] -File: figs/banana.eps Graphic file (type eps) - [73] [74] [75] [76] [77] -File: figs/state4.eps Graphic file (type eps) - [78] -Underfull \hbox (badness 2213) in paragraph at lines 7278--7283 -\OT1/ptm/b/n/10 Exercise 8.10 \OT1/ptm/m/n/10 Read the doc-u-men-ta-tion of the - string meth-ods at $\OT1/pcr/m/n/10 docs . python . org / lib / - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 7284--7289 -[]\OT1/ptm/m/n/10 The doc-u-men-ta-tion uses a syn-tax that might be con-fus-in -g. For ex-am-ple, in - [] - -[79] [80] -Chapter 9. -[81 - -] [82] [83] [84] [85] [86] [87] [88 - -] -Chapter 10. -[89] -File: figs/list_state.eps Graphic file (type eps) - [90] [91] [92] [93] [94] -File: figs/list1.eps Graphic file (type eps) - [95] -File: figs/list2.eps Graphic file (type eps) - - -File: figs/list3.eps Graphic file (type eps) - [96] -File: figs/stack5.eps Graphic file (type eps) - [97] [98] [99] -[100] [101] [102 - -] -Chapter 11. -[103] [104] [105] [106] [107] -File: figs/dict1.eps Graphic file (type eps) - [108] -File: figs/fibonacci.eps Graphic file (type eps) - -[109] -Underfull \hbox (badness 1460) in paragraph at lines 9991--9994 -\OT1/ptm/m/n/10 The \OT1/pcr/m/n/10 global \OT1/ptm/m/n/10 state-ment tells the - in-ter-preter some-thing like, ``In this func-tion, when I say - [] - -[110] [111] [112] [113] [114] -Chapter 12. -[115 - -] [116] [117] [118] [119] -File: figs/tuple1.eps Graphic file (type eps) - -File: figs/dict2.eps Graphic file (type eps) - [120] [121] -[122] [123] [124] -Chapter 13. -[125 - -] [126] [127] [128] [129] -Underfull \hbox (badness 10000) in paragraph at lines 11937--11946 - - [] - - -Underfull \hbox (badness 10000) in paragraph at lines 11937--11946 - - [] - -[130] [131] [132] [133] [134] -Chapter 14. -[135 - -] [136] [137] [138] [139] [140] [141] [142] [143] [144] -Chapter 15. -[145 - -] -File: figs/point.eps Graphic file (type eps) - [146] [147] -File: figs/rectangle.eps Graphic file (type eps) - [148] [149] -File: figs/rectangle2.eps Graphic file (type eps) - - [150] [151] -Underfull \hbox (badness 1024) in paragraph at lines 14008--14010 -[]\OT1/ptm/m/n/10 I have writ-ten a small pro-gram that lists the avail-able co -l-ors; you can down-load it from - [] - -[152] -Chapter 16. -File: figs/time.eps Graphic file (type eps) - -Underfull \vbox (badness 1205) has occurred while \output is active [] - - [153 - -] -[154] [155] [156] [157] [158] -Chapter 17. -[159 - -] [160] [161] [162] [163] [164] [165] [166] [167] [168] -Chapter 18. -[169 - -] [170] -File: figs/card1.eps Graphic file (type eps) - [171] [172] [173] [174] [175] -File: figs/class1.eps Graphic file (type eps) - -[176] [177] [178] [179] [180 - -] -Chapter 19. -[181] [182] [183] [184] -File: figs/TurtleWorld.eps Graphic file (type eps) - -Underfull \vbox (badness 10000) has occurred while \output is active [] - - [185] -[186] [187] [188] [189] [190] [191] [192] [193] [194 - -] -Appendix A. -[195] [196] [197] [198] [199] [200] [201] (./book.ind [202] [203 - -] [204] -[205] [206] [207] [208] [209] [210] [211] [212] [213] [214 - -]) (./book.aux) ) -Here is how much of TeX's memory you used: - 3598 strings out of 493849 - 47174 string characters out of 1152845 - 95839 words of memory out of 3000000 - 6774 multiletter control sequences out of 15000+50000 - 35060 words of font info for 93 fonts, out of 3000000 for 9000 - 714 hyphenation exceptions out of 8191 - 27i,12n,43p,262b,408s stack positions out of 5000i,500n,10000p,200000b,50000s - -Output written on book.dvi (234 pages, 672264 bytes). diff --git a/thinkpython/tex/book.toc b/thinkpython/tex/book.toc deleted file mode 100644 index 1e9383c..0000000 --- a/thinkpython/tex/book.toc +++ /dev/null @@ -1,252 +0,0 @@ -\contentsline {chapter}{Preface}{v} -\contentsline {chapter}{\numberline {1}The way of the program}{1} -\contentsline {section}{\numberline {1.1}The Python programming language}{1} -\contentsline {section}{\numberline {1.2}What is a program?}{2} -\contentsline {section}{\numberline {1.3}What is debugging?}{3} -\contentsline {subsection}{\numberline {1.3.1}Syntax errors}{3} -\contentsline {subsection}{\numberline {1.3.2}Runtime errors}{3} -\contentsline {subsection}{\numberline {1.3.3}Semantic errors}{4} -\contentsline {subsection}{\numberline {1.3.4}Experimental debugging}{4} -\contentsline {section}{\numberline {1.4}Formal and natural languages}{4} -\contentsline {section}{\numberline {1.5}The first program}{6} -\contentsline {section}{\numberline {1.6}Debugging}{6} -\contentsline {section}{\numberline {1.7}Glossary}{7} -\contentsline {section}{\numberline {1.8}Exercises}{8} -\contentsline {chapter}{\numberline {2}Variables, expressions and statements}{9} -\contentsline {section}{\numberline {2.1}Values and types}{9} -\contentsline {section}{\numberline {2.2}Variables}{10} -\contentsline {section}{\numberline {2.3}Variable names and keywords}{11} -\contentsline {section}{\numberline {2.4}Statements}{12} -\contentsline {section}{\numberline {2.5}Operators and operands}{12} -\contentsline {section}{\numberline {2.6}Expressions}{13} -\contentsline {section}{\numberline {2.7}Order of operations}{13} -\contentsline {section}{\numberline {2.8}String operations}{14} -\contentsline {section}{\numberline {2.9}Comments}{14} -\contentsline {section}{\numberline {2.10}Debugging}{15} -\contentsline {section}{\numberline {2.11}Glossary}{15} -\contentsline {section}{\numberline {2.12}Exercises}{16} -\contentsline {chapter}{\numberline {3}Functions}{17} -\contentsline {section}{\numberline {3.1}Function calls}{17} -\contentsline {section}{\numberline {3.2}Type conversion functions}{17} -\contentsline {section}{\numberline {3.3}Math functions}{18} -\contentsline {section}{\numberline {3.4}Composition}{19} -\contentsline {section}{\numberline {3.5}Adding new functions}{19} -\contentsline {section}{\numberline {3.6}Definitions and uses}{20} -\contentsline {section}{\numberline {3.7}Flow of execution}{21} -\contentsline {section}{\numberline {3.8}Parameters and arguments}{21} -\contentsline {section}{\numberline {3.9}Variables and parameters are local}{22} -\contentsline {section}{\numberline {3.10}Stack diagrams}{23} -\contentsline {section}{\numberline {3.11}Fruitful functions and void functions}{24} -\contentsline {section}{\numberline {3.12}Why functions?}{25} -\contentsline {section}{\numberline {3.13}Debugging}{25} -\contentsline {section}{\numberline {3.14}Glossary}{25} -\contentsline {section}{\numberline {3.15}Exercises}{26} -\contentsline {chapter}{\numberline {4}Case study: interface design}{29} -\contentsline {section}{\numberline {4.1}TurtleWorld}{29} -\contentsline {section}{\numberline {4.2}Simple repetition}{30} -\contentsline {section}{\numberline {4.3}Exercises}{31} -\contentsline {section}{\numberline {4.4}Encapsulation}{32} -\contentsline {section}{\numberline {4.5}Generalization}{32} -\contentsline {section}{\numberline {4.6}Interface design}{33} -\contentsline {section}{\numberline {4.7}Refactoring}{34} -\contentsline {section}{\numberline {4.8}A development plan}{35} -\contentsline {section}{\numberline {4.9}docstring}{35} -\contentsline {section}{\numberline {4.10}Debugging}{35} -\contentsline {section}{\numberline {4.11}Glossary}{36} -\contentsline {section}{\numberline {4.12}Exercises}{36} -\contentsline {chapter}{\numberline {5}Conditionals and recursion}{39} -\contentsline {section}{\numberline {5.1}Modulus operator}{39} -\contentsline {section}{\numberline {5.2}Boolean expressions}{39} -\contentsline {section}{\numberline {5.3}Logical operators}{40} -\contentsline {section}{\numberline {5.4}Conditional execution}{40} -\contentsline {section}{\numberline {5.5}Alternative execution}{41} -\contentsline {section}{\numberline {5.6}Chained conditionals}{41} -\contentsline {section}{\numberline {5.7}Nested conditionals}{42} -\contentsline {section}{\numberline {5.8}Recursion}{42} -\contentsline {section}{\numberline {5.9}Stack diagrams for recursive functions}{43} -\contentsline {section}{\numberline {5.10}Infinite recursion}{44} -\contentsline {section}{\numberline {5.11}Keyboard input}{45} -\contentsline {section}{\numberline {5.12}Debugging}{45} -\contentsline {section}{\numberline {5.13}Glossary}{46} -\contentsline {section}{\numberline {5.14}Exercises}{47} -\contentsline {chapter}{\numberline {6}Fruitful functions}{51} -\contentsline {section}{\numberline {6.1}Return values}{51} -\contentsline {section}{\numberline {6.2}Incremental development}{52} -\contentsline {section}{\numberline {6.3}Composition}{54} -\contentsline {section}{\numberline {6.4}Boolean functions}{54} -\contentsline {section}{\numberline {6.5}More recursion}{55} -\contentsline {section}{\numberline {6.6}Leap of faith}{57} -\contentsline {section}{\numberline {6.7}One more example}{57} -\contentsline {section}{\numberline {6.8}Checking types}{58} -\contentsline {section}{\numberline {6.9}Debugging}{59} -\contentsline {section}{\numberline {6.10}Glossary}{60} -\contentsline {section}{\numberline {6.11}Exercises}{60} -\contentsline {chapter}{\numberline {7}Iteration}{63} -\contentsline {section}{\numberline {7.1}Multiple assignment}{63} -\contentsline {section}{\numberline {7.2}Updating variables}{64} -\contentsline {section}{\numberline {7.3}The {\tt while} statement}{64} -\contentsline {section}{\numberline {7.4}{\tt break}}{65} -\contentsline {section}{\numberline {7.5}Square roots}{66} -\contentsline {section}{\numberline {7.6}Algorithms}{67} -\contentsline {section}{\numberline {7.7}Debugging}{68} -\contentsline {section}{\numberline {7.8}Glossary}{68} -\contentsline {section}{\numberline {7.9}Exercises}{69} -\contentsline {chapter}{\numberline {8}Strings}{71} -\contentsline {section}{\numberline {8.1}A string is a sequence}{71} -\contentsline {section}{\numberline {8.2}{\tt len}}{72} -\contentsline {section}{\numberline {8.3}Traversal with a {\tt for} loop}{72} -\contentsline {section}{\numberline {8.4}String slices}{73} -\contentsline {section}{\numberline {8.5}Strings are immutable}{74} -\contentsline {section}{\numberline {8.6}Searching}{74} -\contentsline {section}{\numberline {8.7}Looping and counting}{75} -\contentsline {section}{\numberline {8.8}{\tt string} methods}{75} -\contentsline {section}{\numberline {8.9}The {\tt in} operator}{76} -\contentsline {section}{\numberline {8.10}String comparison}{77} -\contentsline {section}{\numberline {8.11}Debugging}{77} -\contentsline {section}{\numberline {8.12}Glossary}{79} -\contentsline {section}{\numberline {8.13}Exercises}{79} -\contentsline {chapter}{\numberline {9}Case study: word play}{81} -\contentsline {section}{\numberline {9.1}Reading word lists}{81} -\contentsline {section}{\numberline {9.2}Exercises}{82} -\contentsline {section}{\numberline {9.3}Search}{83} -\contentsline {section}{\numberline {9.4}Looping with indices}{84} -\contentsline {section}{\numberline {9.5}Debugging}{85} -\contentsline {section}{\numberline {9.6}Glossary}{86} -\contentsline {section}{\numberline {9.7}Exercises}{86} -\contentsline {chapter}{\numberline {10}Lists}{89} -\contentsline {section}{\numberline {10.1}A list is a sequence}{89} -\contentsline {section}{\numberline {10.2}Lists are mutable}{89} -\contentsline {section}{\numberline {10.3}Traversing a list}{91} -\contentsline {section}{\numberline {10.4}List operations}{91} -\contentsline {section}{\numberline {10.5}List slices}{92} -\contentsline {section}{\numberline {10.6}List methods}{92} -\contentsline {section}{\numberline {10.7}Map, filter and reduce}{93} -\contentsline {section}{\numberline {10.8}Deleting elements}{94} -\contentsline {section}{\numberline {10.9}Lists and strings}{95} -\contentsline {section}{\numberline {10.10}Objects and values}{95} -\contentsline {section}{\numberline {10.11}Aliasing}{96} -\contentsline {section}{\numberline {10.12}List arguments}{97} -\contentsline {section}{\numberline {10.13}Debugging}{98} -\contentsline {section}{\numberline {10.14}Glossary}{99} -\contentsline {section}{\numberline {10.15}Exercises}{100} -\contentsline {chapter}{\numberline {11}Dictionaries}{103} -\contentsline {section}{\numberline {11.1}Dictionary as a set of counters}{104} -\contentsline {section}{\numberline {11.2}Looping and dictionaries}{106} -\contentsline {section}{\numberline {11.3}Reverse lookup}{106} -\contentsline {section}{\numberline {11.4}Dictionaries and lists}{107} -\contentsline {section}{\numberline {11.5}Memos}{109} -\contentsline {section}{\numberline {11.6}Global variables}{110} -\contentsline {section}{\numberline {11.7}Long integers}{111} -\contentsline {section}{\numberline {11.8}Debugging}{112} -\contentsline {section}{\numberline {11.9}Glossary}{112} -\contentsline {section}{\numberline {11.10}Exercises}{113} -\contentsline {chapter}{\numberline {12}Tuples}{115} -\contentsline {section}{\numberline {12.1}Tuples are immutable}{115} -\contentsline {section}{\numberline {12.2}Tuple assignment}{116} -\contentsline {section}{\numberline {12.3}Tuples as return values}{117} -\contentsline {section}{\numberline {12.4}Variable-length argument tuples}{117} -\contentsline {section}{\numberline {12.5}Lists and tuples}{118} -\contentsline {section}{\numberline {12.6}Dictionaries and tuples}{119} -\contentsline {section}{\numberline {12.7}Comparing tuples}{121} -\contentsline {section}{\numberline {12.8}Sequences of sequences}{121} -\contentsline {section}{\numberline {12.9}Debugging}{122} -\contentsline {section}{\numberline {12.10}Glossary}{123} -\contentsline {section}{\numberline {12.11}Exercises}{123} -\contentsline {chapter}{\numberline {13}Case study: data structure selection}{125} -\contentsline {section}{\numberline {13.1}Word frequency analysis}{125} -\contentsline {section}{\numberline {13.2}Random numbers}{126} -\contentsline {section}{\numberline {13.3}Word histogram}{127} -\contentsline {section}{\numberline {13.4}Most common words}{128} -\contentsline {section}{\numberline {13.5}Optional parameters}{128} -\contentsline {section}{\numberline {13.6}Dictionary subtraction}{129} -\contentsline {section}{\numberline {13.7}Random words}{129} -\contentsline {section}{\numberline {13.8}Markov analysis}{130} -\contentsline {section}{\numberline {13.9}Data structures}{131} -\contentsline {section}{\numberline {13.10}Debugging}{132} -\contentsline {section}{\numberline {13.11}Glossary}{133} -\contentsline {section}{\numberline {13.12}Exercises}{134} -\contentsline {chapter}{\numberline {14}Files}{135} -\contentsline {section}{\numberline {14.1}Persistence}{135} -\contentsline {section}{\numberline {14.2}Reading and writing}{135} -\contentsline {section}{\numberline {14.3}Format operator}{136} -\contentsline {section}{\numberline {14.4}Filenames and paths}{137} -\contentsline {section}{\numberline {14.5}Catching exceptions}{138} -\contentsline {section}{\numberline {14.6}Databases}{139} -\contentsline {section}{\numberline {14.7}Pickling}{139} -\contentsline {section}{\numberline {14.8}Pipes}{140} -\contentsline {section}{\numberline {14.9}Writing modules}{141} -\contentsline {section}{\numberline {14.10}Debugging}{142} -\contentsline {section}{\numberline {14.11}Glossary}{143} -\contentsline {section}{\numberline {14.12}Exercises}{143} -\contentsline {chapter}{\numberline {15}Classes and objects}{145} -\contentsline {section}{\numberline {15.1}User-defined types}{145} -\contentsline {section}{\numberline {15.2}Attributes}{146} -\contentsline {section}{\numberline {15.3}Rectangles}{147} -\contentsline {section}{\numberline {15.4}Instances as return values}{148} -\contentsline {section}{\numberline {15.5}Objects are mutable}{148} -\contentsline {section}{\numberline {15.6}Copying}{149} -\contentsline {section}{\numberline {15.7}Debugging}{150} -\contentsline {section}{\numberline {15.8}Glossary}{151} -\contentsline {section}{\numberline {15.9}Exercises}{151} -\contentsline {chapter}{\numberline {16}Classes and functions}{153} -\contentsline {section}{\numberline {16.1}Time}{153} -\contentsline {section}{\numberline {16.2}Pure functions}{154} -\contentsline {section}{\numberline {16.3}Modifiers}{155} -\contentsline {section}{\numberline {16.4}Prototyping versus planning}{156} -\contentsline {section}{\numberline {16.5}Debugging}{157} -\contentsline {section}{\numberline {16.6}Glossary}{158} -\contentsline {section}{\numberline {16.7}Exercises}{158} -\contentsline {chapter}{\numberline {17}Classes and methods}{159} -\contentsline {section}{\numberline {17.1}Object-oriented features}{159} -\contentsline {section}{\numberline {17.2}Printing objects}{160} -\contentsline {section}{\numberline {17.3}Another example}{161} -\contentsline {section}{\numberline {17.4}A more complicated example}{162} -\contentsline {section}{\numberline {17.5}The init method}{162} -\contentsline {section}{\numberline {17.6}The {\tt \_\_str\_\_} method}{163} -\contentsline {section}{\numberline {17.7}Operator overloading}{163} -\contentsline {section}{\numberline {17.8}Type-based dispatch}{164} -\contentsline {section}{\numberline {17.9}Polymorphism}{165} -\contentsline {section}{\numberline {17.10}Debugging}{166} -\contentsline {section}{\numberline {17.11}Glossary}{166} -\contentsline {section}{\numberline {17.12}Exercises}{167} -\contentsline {chapter}{\numberline {18}Inheritance}{169} -\contentsline {section}{\numberline {18.1}Card objects}{169} -\contentsline {section}{\numberline {18.2}Class attributes}{170} -\contentsline {section}{\numberline {18.3}Comparing cards}{171} -\contentsline {section}{\numberline {18.4}Decks}{172} -\contentsline {section}{\numberline {18.5}Printing the deck}{172} -\contentsline {section}{\numberline {18.6}Add, remove, shuffle and sort}{173} -\contentsline {section}{\numberline {18.7}Inheritance}{174} -\contentsline {section}{\numberline {18.8}Class diagrams}{175} -\contentsline {section}{\numberline {18.9}Debugging}{176} -\contentsline {section}{\numberline {18.10}Glossary}{177} -\contentsline {section}{\numberline {18.11}Exercises}{178} -\contentsline {chapter}{\numberline {19}Case study: Tkinter}{181} -\contentsline {section}{\numberline {19.1}GUI}{181} -\contentsline {section}{\numberline {19.2}Buttons and callbacks}{182} -\contentsline {section}{\numberline {19.3}Canvas widgets}{183} -\contentsline {section}{\numberline {19.4}Coordinate sequences}{184} -\contentsline {section}{\numberline {19.5}More widgets}{184} -\contentsline {section}{\numberline {19.6}Packing widgets}{185} -\contentsline {section}{\numberline {19.7}Menus and Callables}{188} -\contentsline {section}{\numberline {19.8}Binding}{189} -\contentsline {section}{\numberline {19.9}Debugging}{191} -\contentsline {section}{\numberline {19.10}Glossary}{191} -\contentsline {section}{\numberline {19.11}Exercises}{192} -\contentsline {chapter}{\numberline {A}Debugging}{195} -\contentsline {section}{\numberline {A.1}Syntax errors}{195} -\contentsline {subsection}{\numberline {A.1.1}I keep making changes and it makes no difference.}{196} -\contentsline {section}{\numberline {A.2}Runtime errors}{197} -\contentsline {subsection}{\numberline {A.2.1}My program does absolutely nothing.}{197} -\contentsline {subsection}{\numberline {A.2.2}My program hangs.}{197} -\contentsline {subsubsection}{Infinite Loop}{197} -\contentsline {subsubsection}{Infinite Recursion}{198} -\contentsline {subsubsection}{Flow of Execution}{198} -\contentsline {subsection}{\numberline {A.2.3}When I run the program I get an exception.}{198} -\contentsline {subsection}{\numberline {A.2.4}I added so many {\tt print} statements I get inundated with output.}{199} -\contentsline {section}{\numberline {A.3}Semantic errors}{199} -\contentsline {subsection}{\numberline {A.3.1}My program doesn't work.}{200} -\contentsline {subsection}{\numberline {A.3.2}I've got a big hairy expression and it doesn't do what I expect.}{200} -\contentsline {subsection}{\numberline {A.3.3}I've got a function or method that doesn't return what I expect.}{201} -\contentsline {subsection}{\numberline {A.3.4}I'm really, really stuck and I need help.}{201} -\contentsline {subsection}{\numberline {A.3.5}No, I really need help.}{202} diff --git a/thinkpython/tex/thinkpython.ps b/thinkpython/tex/thinkpython.ps deleted file mode 100644 index 4650c19..0000000 Binary files a/thinkpython/tex/thinkpython.ps and /dev/null differ