Learning to program and learning the basics of control flow can be tricky business for novices. I wanted to make something that provided immediate, visual feedback to students as they practice things like
for loops and
if statements so they can see precisely what their code is (or isn’t) doing. So I wrote ipythonblocks.
The IPython Notebook makes it possible to display rich representations of Python objects using HTML (among other things). That allowed me to make a Python object whose representation in the Notebook is a colored table. Students can index into the table to change the color properties of individual table cells and then immediately display their changes.
ipythonblocks instructors can give coding problems like ‘turn every block in the third column red’ or ‘turn every blue block green’ and by displaying their blocks students can see right away whether their code is having the desired effect.
Check out the demo notebook to see ipythonblocks in action.
3 thoughts on “ipythonblocks – A Visual Tool for Practicing Python”
Awesome job, Matt!
[…] got a blog post up over on the Software Carpentry blog about trying out ipythonblocks in the classroom for the first time. Summary: it was a hit! The students really got a lot out of […]
[…] a year ago, inspired by Greg Wilson, I wrote ipythonblocks as a fun way for students (and anyone else!) to […]