exception handling update to Python 3, PEP 8-itizing the code.
exception handling updated to Python 3 convention, PEP 8-itizing the code.
print statement changed to Python 3 convention