There are a number of PEP8 issues here (long lines, trailing whitespace, over indentation).