Your file has Windows line endings, which unix shells don't like.
Just convert them to Unix file endings using
dos2unix aaa.py (you may need to install
dos2unix, which is a very light [200kB] but useful software) and you should be fine.
Different line endings representations are a common source of "strange" problems. You can check line endings with
file <yourfile> if it says something like:
<yourfile>: ASCII text,
with CRLF line terminators
It means it has Windows line endings and you should convert them to unix, using
dos2unix, the vim command
:set ff=unix or your favourite text editor if it has the feature (many do).