head first python chapter3: file and error control