程序框架
********

本章中描述的模块是很大程度上决定程序结构的框架。 目前，这里描述的模块
都面向编写命令行接口。

本章描述的完整模块列表如下：

* "turtle" --- 海龟绘图

  * 概述

  * 入门

  * 教程

    * 启动海龟环境

    * 基本绘图

      * 画笔控制

      * 海龟的位置

    * 使用算法绘制图案

  * 如何...

    * 尽快地开始

    * 使用 "turtle" 模块命名空间

    * 在脚本中使用海龟绘图

    * 使用面向对象的海龟绘图

  * 海龟绘图参考

    * Turtle 方法

    * TurtleScreen/Screen 方法

  * RawTurtle/Turtle 方法和对应函数

    * 海龟动作

      * "forward()"

      * "fd()"

      * "back()"

      * "bk()"

      * "backward()"

      * "right()"

      * "rt()"

      * "left()"

      * "lt()"

      * "goto()"

      * "setpos()"

      * "setposition()"

      * "teleport()"

      * "setx()"

      * "sety()"

      * "setheading()"

      * "seth()"

      * "home()"

      * "circle()"

      * "dot()"

      * "stamp()"

      * "clearstamp()"

      * "clearstamps()"

      * "undo()"

      * "speed()"

    * 获取海龟的状态

      * "position()"

      * "pos()"

      * "towards()"

      * "xcor()"

      * "ycor()"

      * "heading()"

      * "distance()"

    * 度量单位设置

      * "degrees()"

      * "radians()"

    * 画笔控制

      * 绘图状态

        * "pendown()"

        * "pd()"

        * "down()"

        * "penup()"

        * "pu()"

        * "up()"

        * "pensize()"

        * "width()"

        * "pen()"

        * "isdown()"

      * 颜色控制

        * "pencolor()"

        * "fillcolor()"

        * "color()"

      * 填充

        * "filling()"

        * "begin_fill()"

        * "end_fill()"

      * 更多绘图控制

        * "reset()"

        * "clear()"

        * "write()"

    * 海龟状态

      * 可见性

        * "hideturtle()"

        * "ht()"

        * "showturtle()"

        * "st()"

        * "isvisible()"

      * 外观

        * "shape()"

        * "resizemode()"

        * "shapesize()"

        * "turtlesize()"

        * "shearfactor()"

        * "tilt()"

        * "tiltangle()"

        * "shapetransform()"

        * "get_shapepoly()"

    * 使用事件

      * "onrelease()"

      * "ondrag()"

    * 特殊海龟方法

      * "begin_poly()"

      * "end_poly()"

      * "get_poly()"

      * "clone()"

      * "getturtle()"

      * "getpen()"

      * "getscreen()"

      * "setundobuffer()"

      * "undobufferentries()"

    * 复合形状

  * TurtleScreen/Screen 方法及对应函数

    * 窗口控制

      * "bgcolor()"

      * "bgpic()"

      * "clearscreen()"

      * "resetscreen()"

      * "screensize()"

      * "setworldcoordinates()"

    * 动画控制

      * "delay()"

      * "tracer()"

      * "update()"

    * 使用屏幕事件

      * "listen()"

      * "onkey()"

      * "onkeyrelease()"

      * "onkeypress()"

      * "onclick()"

      * "onscreenclick()"

      * "ontimer()"

      * "mainloop()"

      * "done()"

    * 输入方法

      * "textinput()"

      * "numinput()"

    * 设置与特殊方法

      * "mode()"

      * "colormode()"

      * "getcanvas()"

      * "getshapes()"

      * "register_shape()"

      * "addshape()"

      * "turtles()"

      * "window_height()"

      * "window_width()"

    * Screen 专有方法, 而非继承自 TurtleScreen

      * "bye()"

      * "exitonclick()"

      * "save()"

      * "setup()"

      * "title()"

  * 公共类

    * "RawTurtle"

    * "RawPen"

    * "Turtle"

    * "TurtleScreen"

    * "Screen"

    * "ScrolledCanvas"

    * "Shape"

      * "addcomponent()"

    * "Vec2D"

  * 说明

  * 帮助与配置

    * 如何使用帮助

    * 文档字符串翻译为不同的语言

      * "write_docstringdict()"

    * 如何配置 Screen 和 Turtle

  * "turtledemo" --- 演示脚本集

  * Python 2.6 之后的变化

  * Python 3.0 之后的变化

* "cmd" --- 对面向行的命令解释器的支持

  * "Cmd"

  * Cmd 对象

    * "cmdloop()"

    * "do_help()"

    * "onecmd()"

    * "emptyline()"

    * "default()"

    * "completedefault()"

    * "columnize()"

    * "precmd()"

    * "postcmd()"

    * "preloop()"

    * "postloop()"

    * "prompt"

    * "identchars"

    * "lastcmd"

    * "cmdqueue"

    * "intro"

    * "doc_header"

    * "misc_header"

    * "undoc_header"

    * "ruler"

    * "use_rawinput"

  * Cmd 例子

* "shlex" --- 简单词法分析

  * "split()"

  * "join()"

  * "quote()"

  * "shlex"

  * shlex 对象

    * "get_token()"

    * "push_token()"

    * "read_token()"

    * "sourcehook()"

    * "push_source()"

    * "pop_source()"

    * "error_leader()"

    * "commenters"

    * "wordchars"

    * "whitespace"

    * "escape"

    * "quotes"

    * "escapedquotes"

    * "whitespace_split"

    * "infile"

    * "instream"

    * "source"

    * "debug"

    * "lineno"

    * "token"

    * "eof"

    * "punctuation_chars"

  * 解析规则

  * 改进的 shell 兼容性
