Fixed bug in writing the downloaded file's report to disk

The print function takes an optional file-like object, not the path of a file
(oops!). Therefore had to open a file stream and pass that to print instead
Tidied up code formatting to be more complient with PEP-8