Memo to self: when running a Python script, either put in a '#! /usr/bin/python' as the first line or have it as an argument to python. Don't run the script directly or it will be interpreted as a shell script and the results could be nasty. Fortunately, they were just a bit confusing this time…