Spyder Python IDE
Tools for writing Python
An Integrated Development Environment (IDE) is software that integrates tools for programming.
As we’ve seen, for Code Club, the basic tools we need for kids to program in Python are (assuming we’ve install Python):
- a Python shell to try out commands with immediate feedback
- an editor, with a simple interface, to create Python scripts containing our code
- an environment to run our scripts that gives us errors when we make mistakes
Other features, I see as optional, but useful include:
- syntax highlighting, where our code is colour coded to make formatting mistakes more obvious when editing;
- auto-completion, where the editor helps us a bit by suggesting commands that might be useful (I think this can be a little confusing when just starting); and
- a debugging interface that can let us stop, or single-step, our code while it is running, so we can find where our script might be going wrong.
Our first experiences at Code Club
When we first started doing Python activities, the main problem that came up was kids getting confused as to whether they were in a Python shell, editing, or running their code. Once we explained that their script was just a text file, and that they could edit it in something as simple as notepad, things became a little easier. Some of us had a bit of an issue with typing things out, so it was good to run code often and see things happening. Some of us preferred Windows and some preferred MacOSX. That’s where the Python cheat sheet (see the link above) came from.
Something to try
As we have a mixture of netbooks, macbooks, and imacs, and 3 Raspberry Pis, the environment we’ve been writing our code in varies. Being a bit of a nerd, in an effort to make sure we at least do something during our Code Club session, I’ll often just use whatever text editor I can find to write Python. Sometimes this includes the nano editor, which I’m sure everyone gets a bit frustrated with, but I firmly believe will help us be more adaptable when we don’t have a pretty graphical interface. I’m sure this drives people a bit mad ;) but hopefully it’s all good when the code eventually runs :).
After all this rambling on, the main point is that I tried the Spyder Python IDE (Scientific PYthon Development EnviRonment) recently, and it seems close to what we need. Personally I like things like Wing IDE but for teaching kids we just need something simple, where they get the main tools listed above. Spyder seems to run on the operating systems we encounter, and unlike some of the other tools, has a more intuitive interface for kids. It also has syntax highlighting and tells them what version of Python they are using. To me, it’s important that people have a tool they can use install and use at home, since Code Club is only one hour a week for us.
Anyway, it looks like this:
If you’d like to try it, there’s instructions for installing Spyder version 2 here