Since this is an "executable" file, you should probably add a shebang to the first line. `#!/usr/bin/env python` should suffice.