File And Error Handling In Python