turtle dump

alex23 wuwei23 at gmail.com
Thu Jul 16 20:37:00 EDT 2009


> >> Help on method postscript:
> >> postscript(self, *args, **kw) method of turtle.ScrolledCanvas instance
> >> is spectacularly useless.
>
> This is from interactive help.

The help in iPython says the same, but also mentions that it's a
dynamically generated function, so it may not be picking up the
docstring that way. turtle.ScrolledCanvas.postscript is similarly
terse, but you can find more info in turtle.Canvas.postscript:

  Print the contents of the canvas to a postscript
  file. Valid options: colormap, colormode, file, fontmap,
  height, pageanchor, pageheight, pagewidth, pagex, pagey,
  rotate, witdh, x, y.

> The doc says
>
> " Return the Canvas of this TurtleScreen. Useful for insiders who know
> what to do with a Tkinter Canvas."
>
> > The module is a bit messy, but the accompanying documentation seems OK to
> > me.
>
> ?? I am not an 'insider' ;-).

I don't think the intent of the turtle module is to be a primer in Tk,
but more of an educational tool. The lack of image export niceties has
a lot to do with the limitations of Tk, but was probably (and I'm
conjecturing here) felt to be outside the scope of what the module
aims to achieve.

> Of Canvas, mostly methods. I can understand that no one who could write
> decent doc strings for the 100 methods has actually volunteered to do so.

I think they all _have_ doc strings, or at least the code they
eventually call does, but I'd have to look into the module itself to
see if they could be brought over dynamically.

You may be interested in the final page of Greg Lingl's PyCon talk,
Seven Ways to use Turtle[1] which states:

  The turtle module is designed in a way so that essentially all of
the turtle
  graphics machinery is based on a class TurtleScreenBase, which
provides the
  interface to the underlying graphics toolkit Tkinter.

  So it‘s easy to port turtle.py to different graphics toolkits/
libraries,
  simply by replacing this Tkinter base class with an appropriate
different one.

  I‘ve done two ports: Pygame & Jython

If you're after bitmap, I'd suggest contacting Greg and asking about
the Pygame port. His contact info can be found at the original site
for the revised turtle module[2], hopefully it's still up to date.

1: us.pycon.org/media/2009/talkdata/PyCon2009/065/SevenWaysToUseTurtle-
PyCon2007.pdf
2: http://xturtle.rg16.at/download.html



More information about the Python-list mailing list