import xlwt
book = xlwt.Workbook(encoding="utf-8")
sheet1 = book.add_sheet("Python Sheet 1")
sheet2 = book.add_sheet("Python Sheet 2")
sheet3 = book.add_sheet("Python Sheet 3")
sheet1.write(0, 0, "This is the First Cell of the First Sheet")
sheet2.write(0, 0, "This is the First Cell of the Second Sheet")
sheet3.write(0, 0, "This is the First Cell of the Third Sheet")
sheet2.write(1, 10, "This is written to the Second Sheet")
sheet3.write(0, 2, "This is part of a list of information in the Third Sheet")
sheet3.write(1, 2, "This is part of a list of information in the Third Sheet")
book.save("python_spreadsheet.xls")
Does anyone know why I am getting this error? I literally just copied this code from the package's demo website and I got this error.
IOError: [Errno 13] Permission denied: 'python_spreadsheet.xls'
Most likely, you don't have the permissions to write a file in that particular folder. Check if you have permissions to write in that particular folder.
Also, defining an absolute path for the file might help.