Python on Linux requires unix line endings. Your line endings were in Windows/DOS format. I changed them to unix endings and it works now.
If you're editing on Windows, my suggestion is to use an editor like Notepad++. You can author files using Unix endings using Edit->EOL Conversion->Unix in that editor.