

Learn to program Python using a Logo-like turtle - ronreiter
http://www.learnpython.org
Good for teachers who don't want to set up any programming environment.
learnpython.org is a new website I've developed for the Python learning community. I would love people to help me out write more tutorials, or develop the logo turtle programming idea further.<p>Tell me what you think. Thanks!
======
edw
This—as well as Logo, however fond my memories of it are—are a bad idea
because turtles graphics are by nature _imperative_ : you're programming
exclusively for side effects.

What the world needs is an approachable version of a system like the image
manipulation presented in _Structure and Interpretation of Computer Programs_
, which takes a functional approach. (It may have only been in the first
edition, but it is covered in the Hewlett-Packard videos.)

I'm not a functional programming absolutist, but experience has taught me to
think functionally by default. The habit should be instilled in would-be
programmers as early as possible.

~~~
dpritchett
I haven't finished SICP so I'm not sure which bit you're talking about, could
you please point it out? [http://mitpress.mit.edu/sicp/full-text/book/book-
Z-H-4.html#...](http://mitpress.mit.edu/sicp/full-text/book/book-
Z-H-4.html#%_toc_start)

All IO is inherently impure, right? At best you're going to be composing
funtions out of smaller functions that implement your graphics desires.

How can you get around having e.g. a circle(radius, x-pos, y-pos, line-color,
fill-color) function that draws per your specifications? There's no reason you
couldn't implement that circle function using turtle...

~~~
hendzen
All the exercises and code in Section 2.2.4

------
Florin_Andrei
Funny coincidence. Just yesterday, I started teaching my 9yr old son
programming - he kept pestering me for a while after the science fair at the
school, where one of his buddies had a "programming" project.

Long story made short - I ended up choosing Python. Intuitively, I strongly
resisted this conclusion. But in the end, it made sense: the syntax is clean
(some would say too rigid, I say that's okay for a teaching language), it's
pretty hard to obfuscate the code (unlike Perl), you can do "import turtle"
and voila it's Logo, and there are plenty of tutorials and books geared
towards beginners including young children.

We had lots of fun doing things like:

>>> import turtle

>>> t = turtle.Pen()

>>> t.forward(50)

>>> t.left(90)

>>> t.forward(50)

I showed him variables, a little bit about strings and lists. Next up: loops,
if/else, etc.

I'm following this book:

[http://www.briggs.net.nz/log/writing/snake-wrangling-for-
kid...](http://www.briggs.net.nz/log/writing/snake-wrangling-for-kids/)

------
BoppreH
There's also a "turtle" module that came included in my Py3k distribution. Not
sure about 2.x versions.

Giving commands like "turtle.forward(10)" opens an asynchronous tk window
showing the "turtle" (an arrow, really) and a line where it has passed. The
window remains open, the focus goes back to the python interpreter, and you
are free to type new commands.

~~~
Florin_Andrei
Yeah, it's in 2.x too.

------
amyshelton
This is cool. An interesting tidbit. We actually used Logo as a programming
metaphor when creating our telescope observation software for the Green Bank
Telescope (<http://www.gb.nrao.edu/gbt/>) in Python. The observation software
has been in operation for about 8 years now and has been very successful.

------
chrisclark1729
The Next Chapter button is not working for me in Firefox after completing the
Hello World section

~~~
ronreiter
I'll check that out. Thanks.

~~~
imjk
I'm having the same issue (using Firefox), but thank you so much for this.

