usermodel = JPackage('org.apache.poi.hssf.usermodel')
java_io = JPackage('java.io')
wb = usermodel.HSSFWorkbook()
sheet = wb.createSheet('Java rulez')
for i in xrange(8):
row = sheet.createRow(i)
for j in xrange(8):
style = wb.createCellStyle()
style.setFillPattern(usermodel.HSSFCellStyle.SOLID_FOREGROUND)
style.setFillForegroundColor(0x40-i*8+j)
row.createCell(j).setCellStyle(style)
out = java_io.FileOutputStream('wow.xls')
wb.write(out)
out.close()
и ничего лишнего ;)