Hacker News new | past | comments | ask | show | jobs | submit login
PythonTurtle - the most low-threshold way for learning/teaching Python (pythonturtle.com)
73 points by cool-RR on Aug 1, 2009 | hide | past | favorite | 26 comments



This is my little side project that I've been working on for a few months.

It is a way for curious people who are not computer-savvy to teach themselves Python. Of course, it can also be used in a class with an instructor.

Yes, I am aware of turtle.py, the turtle module shipped with the Python standard library. It has a few problems which I found unforgivable: mainly that it's not geared towards people who may not know anything about programming, or how to use IDLE. This is why I decided to make this project.

I'd love to get your comments and feedback.


Hi,

Cool project.

The only issue I found with it so far is that unlike the old logo, the borders of the 'world' aren't circular. That means that if you type 'go(500)' from the opening position, the turtle disappears.

But it's a minor issue, really. My kid is 4 and I'm going to show it to him tomorrow, see how he likes it.


I agree, it's a bit annoying that it continues into infinity; I considered having a "spherical" world, but the problem is that the window size may change, and I don't know how I could keep it consistent when it happens. If you got an idea on how to solve that I'll consider it.


Nice.

I see from the source that you're using wxwidgets so it should be easy to port it to OS X and linux as well.


That's right, it's all Python and wxPython so porting it should be trivial. A Mac version will come, I hope that someone more Mac-savvy than myself will help me with making it.


It works as is on Ubuntu.

PythonTurtle screenshot with a dragon curve http://img35.imageshack.us/i/screenshotpythonturtled.png/

    >>> def dragon(level=4, size=200, direction=45):
    ...     """From http://rosettacode.org/wiki/Dragon_curve
    ...     """
    ... 	if level == 0:
    ... 		go(size)
    ... 		return
    ... 	turn(direction)
    ... 	dragon(level-1, size/1.41421356237, 45)
    ... 	turn(-direction*2)
    ... 	dragon(level-1, size/1.41421356237, -45)
    ... 	turn(direction)
    ... 
    >>> dragon(10)


I'll look at it today and see if I can get it up on the Mac


I have some friends whose kids are approaching the computer-capable age. I've been keeping my eyes open for environments that might intrigue and inspire them. I'm adding yours to the list.

I like the idea of it being Python, so that perhaps they might smoothly transition from fun to "real" problem solving (which is, I find, the most fun of all).


What else is on your list so far?


Off the top of my head (it's a mental list and some saved pages/bookmarks I'd have to track down):

Scratch (MIT)

Alice (Cornell, IIRC -- just saw that an update is due next week)

One or more versions of Logo (e.g Berkeley) (recently, there's at least one that's hosted in the browser; might lower the gap since no explicit installation is required).

A couple of things I'm forgetting right now.

When I run across these or particularly a nice introduction to one or another, I forward the page on to the parents FYI. When/if they start to respond with "tell us more", I'll go more in depth (and excavate those pages and bookmarks).

Suggestions welcome. Since they're not my kids, my approach has been somewhat lackadaisical.


This was recently on HN:

http://www.technologyreview.com/computing/22919/

This other program is great for either children or adults:

http://brainworkshop.sourceforge.net/


Reminds me a lot of Logo. I think back in 1st grade computer class it was a turtle we controlled as well.

Also, in AP Comp Sci we went over the basics of functions by making a turtle move across a plane.

Why turtles?


They're called turtles because, back in the day, they were actual robots that looked like turtles. http://www.ias.uwe.ac.uk/Robots/gwonline/gwonline.html


Yep, they had one of those at my primary school.


Yeah, it's directly inspired from Logo. Logo was great because you were immediately able to program, and immediately see the results on the screen. There wasn't any annoying procedures to do before you could start, no graphics packages to learn. That was my goal here -- to have as few barriers as possible between the person and the programming.

Why turtles? I don't know actually, I'm just following Logo's convention. Some implementations make it a little arrow - I prefer the turtle, especially because kids like it better. Though there isn't really a reason that a turtle should leave a trail, so maybe a slug would make more sense.


Yes. I'm very much in favor of "desired results quickly". For kids, that may be something cool and graphical and/or audible.

For adults, it's often solving a problem at hand.

I think that the ability to gets things done, that one desires, draws many people in. A large initial learning curve before that happens is often a deal breaker.

Once you're engaged, that's the time to keep teaching you more.


Super! I know a kid that has been literally begging me to teach him programming and I have been looking high and low for something like this. The closest I got so far was a logo in javascript: http://www.calormen.com/Logo/


Just gave it a try on a Windows Vista box and it crashes on startup. I'm going to give it a try on Windows XP later when I wake up from my "nap" as I haven't slept yet ;)

This is a great and noble initiative and I look forward to checking it out when I'm more than semi-conscious. Please, no wise ass correlations between semi-consciousness and the use of Windows Vista :D

I'm Swayze.


Thanks for telling me - I don't have a Vista box, but I should definitely solve that. I think I'll install Vista on VMWare and look at that.


Solved! Download the new version from the site.

Tell me if it gives you a weird error message after you close the program.


Crashes on Windows 7 as well at startup. Compatibility modes and running under admin privileges didn't help either.


I solved the Vista problem - please re-download it and tell me if it works on Win 7 now.


I'll get on it.


requires administrator privileges at startup. Once launched with admin privileges, fails with following error: Failed to load shared library comctl32.dll (error 126: the specified module could not found)

Note that there's a comctl32.dll on windows\system32.

Edit: Never mind, I left it at compatibility mode. Reverted back to native run mode and it's working fine now except that at upon exit, it complains about not being able to open log file because of privilege issues.


Right, I saw that log file thing on Vista too, I'll look into that. But as long as it works, that's good enough. Thanks to you I don't have to start downloading Windows 7 :)


This reminds me of Karel, another beginner language that lets you move a robot.

http://en.wikipedia.org/wiki/Karel_%28programming_language%2...




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: