It's generally a good idea to put file operations in try/except blocks so that IOErrors can be handled gracefully rather than with a tracebacks and a quitting of the program.