[Edu-sig] teaching python using turtle module

kirby urner kirby.urner at gmail.com
Sun Nov 29 20:22:29 EST 2009


On Sun, Nov 29, 2009 at 2:51 PM, Edward Cherlin <echerlin at gmail.com> wrote:

<< snip >>

> Drunkard's Walk.
>

If our think tank (isepp.org) could have gotten permission, we'd have
used that Monopoly guy (looks kinda like Planters peanut guy) randomly
walking on like some chess board with a lamp post (reminds of Narnia).
 We don't have that kind of dough though, so just do this conceptually
(conceptual art).

>> Are there any other situations, using turtle, that these
>> structures would be natural?
>
> Recent versions of TA contain stack instructions: push, pop, read,
> clear. Your students might find it interesting to program Forth
> instructions in TA or Python. This has practical applications in
> implementing and porting virtual machines such as Parrot and the VMs
> in Smalltalk and I-APL.
>
> There is plenty more where this came from. You would also be welcome
> to adapt the Python source code for TA tiles to your environment.
>

I recall Alan Kay communicating Seymour Papert's sense that having "an
explicit receiver" was an OK development.  What he meant by that, in
Smalltalk terms, is that the original Logo had what I'd call a
"context turtle" in that FORWARD or RIGHT were w/r to a given Turtle
one didn't need to mention explicitly, like what else could one mean?

With Python and other object oriented implementations, one first gives
birth to a turtle, creates an instance, as in:

>>> someturtle = Turtle()

That's binding a name to a turtle object (giving some turtle object a
name) and then controlling said turtle through the API using dot
notation against the name, e.g. someturtle.forward(10) or
someturtle.right(90).

What you get from this is, of course, the possibility of multiple
turtles, each with its own pen color, visibility, other properties of
self-hood.

This gets showcased in the default demo (in Windows, just double click
on turtle.py in the Lib subdirectory):
http://www.flickr.com/photos/17157315@N00/4145780784/
(using Gregor's 3.1 code just minutes ago)

IronPython also has access to the .NET turtle library:
http://www.flickr.com/photos/mfoord/3104991233/
(not my computer)

I suppose I'm only bringing this up to (a) name drop about being in a
meeting with Alan Kay (with Guido and Mark Shuttleworth among others)
and (b) to remind readers that Logo and turtle art, or the art of
programming with turtles, are orthogonal axes.

Logo as a language has also been extended considerably, as has the
richness of the environment.  Some of these are commercial,
proprietary offerings.

Some of these feature "spatial turtles" in a "turtle tank" i.e. each
turtle is more like a biplane in a WWI dogfight (Snoopy vs. Red
Baron), with all those extra degrees of freedom (roll, pitch, yaw).

Python's turtle module is not, repeat not, an implementation of Logo
in the Python language.  It's an implementation of turtle graphics on
a Tk canvas in the Python language.

You'll also find a turtle module in wxPython such as in PythonCard by
Kevin Altis.
http://pythoncard.sourceforge.net/samples/turtle.html

I think Gregor is right to see turtle.py as an easy way to implement
an Objects First approach, consistent with a more generic approach to
math concepts (vectors, polynomials, polyhedra) as objects (types),
extending the OO rubric.

We teach maths as extensible type systems that advance through the
invention of new types, not just as systems evolving through a
progression of proved theorems from fixed axioms.

Kirby


>> thanks,
>> Brian Blais
>> --
>> Brian Blais
>> bblais at bryant.edu
>> http://web.bryant.edu/~bblais
>>
>>
>>
>> _______________________________________________
>> Edu-sig mailing list
>> Edu-sig at python.org
>> http://mail.python.org/mailman/listinfo/edu-sig
>>
>>
>
>
>
> --
> Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
> Silent Thunder is my name, and Children are my nation.
> The Cosmos is my dwelling place, the Truth my destination.
> http://www.earthtreasury.org/
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>



-- 
>>> from mars import math
http://www.wikieducator.org/Martian_Math



More information about the Python-list mailing list