Sunday, September 30, 2012

Python Again This Year

Python went well enough in the classroom last school year that I'll be using it again this year. Last year we had to leave aside graphics programming because of problems with getting a working graphics library on Mac with Python 3 (Pygame, specifically. There are folks working on its problems.) But the students had a lot of fun even with the text programs from Invent Your Own Computer Programs with Python and their own variations on them. So that's enough to make Python worthwhile in class.

We'll be doing the same, and if Pygame works, we'll be adding that as well. Frankly, dealing with version differences between Python 3.x and 2.x in class is something that I don't feel would be productive, so if we don't have a Pygame that works with Python 3 on our Macs in the school's lab, I won't be going to Python 2.x to get it. We'll move on to something else. For middle school, we'll probably continue with more text programs and have fun with formatting and such. For the high school classes, we'll move over to Greenfoot with Java to do a video game project. In the past, my high school students have dealt with the differences between Python to Java without much trouble. The middle school students who have outside experience with programming are similarly capable, but those who haven't or don't do any sort of programming or scripting outside of class struggle with the changes, so it's best just to avoid the change over at that level.

Prior to Python, the students will have had experience with HTML and CSS. Which presents another opportunity for output that's more interesting than simple console text--Python-generated HTML/CSS code. I've found HTML and CSS to be a good introduction to a lot of the concepts of programming, so it's often the first thing we do along those lines.

Finally, I can't say enough about how great a resource Al Sweigart's book is for my classes. It's a great introduction to programming, no matter the language, and Python makes a good starting language in spite of the "formatting as syntax" issues. It makes a great 21st century version of the great beginners' BASIC books of the 70s and 80s.

Here's hoping the Pygame/graphics issues will get resolved. If not, I need to take another look and see if the turtle graphics package is included in Python or will work with minimal effort on my part. If so, then I can prepare some lessons of my own using it to pick up where the text section of the Sweigart book leaves off.

4 comments:

  1. Turtle should be included in Python:

    http://docs.python.org/py3k/library/turtle.html

    I hope Pygame get the Python 3 builds sorted out, though.

    ReplyDelete
    Replies
    1. Yeah, that's what I recall, I just need to put together some lessons to introduce turtle's main features.

      Thanks!

      Delete
  2. Pygame + mac has always been a bit of a headache. Pygame hasn't seen much development lately, so I don't think that's going to get a lot better.

    I've got another resource you might be interested in for learning to program with Python: http://ProgramArcadeGames.com

    ReplyDelete