Questions tagged [xlwt]

Library to create spreadsheet files compatible with MS Excel 97/2000/XP/2003 XLS files, on any platform.

xlwt is a Python library for modifying and generating spreadsheet files that are compatible with Excel 97/2000/XP/2003, OpenOffice.org Calc, and Gnumeric.

xlwt does not (yet) support Excel 2007 (.xlsx, .xlsm) writing.

xlwt has full support for Unicode. Excel spreadsheets can be generated on any platform without needing Excel or a COM server. The only requirement is Python 2.3 or higher. xlwt is a fork of pyExcelerator.

http://pypi.python.org/pypi/xlwt

640 questions
5
votes
1 answer

Write list of lists to excel file using xlwt

I have a list of lists like: [ [u'email', u'salutation', u'firstname', u'lastname', u'remarks', None, None, None, None, None], [u'harry@harrypotter.com', u'Mr', u'Daniel', u'Radcliffe', u'expecto patronum', None, None, None, None,…
Pranjal Mittal
  • 10,772
  • 18
  • 74
  • 99
5
votes
4 answers

Writing resutls into 2 different sheets in the same Excel file

can you teach me whether Python can write into a same Excel file, but 2 different spreadsheets (tabs)? Just for example, I want to pick and write the titles of below 4 websites, and write them into the same file title.xls but respectively in its…
Mark K
  • 8,767
  • 14
  • 58
  • 118
5
votes
1 answer

Changing default page breaks in xls-file via Python module xlwt

I am trying to edit page breaks using Python module xlwt. (Yes I've found a very similar question xlwt - How to add page breaks to an Excel File? but it didn't clear the problem completely) Here is some code that doesn't work as I expect: import…
BernarditoLuis
  • 157
  • 3
  • 12
5
votes
1 answer

Writing date format using xlwt

I'm writing a date using xlwt like this: date_format = XFStyle() date_format.num_format_str = 'dd/MM/yyyy' plan.write(1,4,'01/01/2014', date_format) The worksheet is saving fine, with no errors. But even this cell is formatted as date, excel not…
Antonio
  • 482
  • 1
  • 5
  • 16
5
votes
2 answers

List of Dictionary to xlwt

I have a list of dictionary and i want to convert it to excel using xlwt. I'm new to xlwt. Can you help me? Im using it as a function to receive list of dict and convert it to excel and then return. I have this list of dict.…
Nethan
  • 251
  • 1
  • 6
  • 18
5
votes
1 answer

UnicodeDecodeError with xlwt

I'm using python with xlwt and have a problem My code: tickets = cursor.fetchall () largo = len(tickets) cursor.close () conn.close () row = 4 for t in tickets: hoja.write(row, 1, t[0]) hoja.write(row, 2, epoch2fecha(t[1])) hoja.write(row,…
R. Stark
  • 177
  • 1
  • 2
  • 6
5
votes
2 answers

Beginner Python: Saving an excel file while it is open

I have a simple problem that I hope will have a simple solution. I am writing python(2.7) code using the xlwt package to write excel files. The program takes data and writes it out to a file that is being saved constantly. The problem is that…
Brian HK
  • 860
  • 1
  • 8
  • 18
5
votes
3 answers

Python xlwt : using easyxf to stylize cells when writing bug

I need to stylize certain cells and rows in an xls file I create through my program, but I am having a few issues, possible misconceptions about how the xlwt easyxf stuff works. First, if I write to the cell without a value and just the style, does…
Michael M
  • 466
  • 2
  • 7
  • 14
5
votes
3 answers

How to apply bold style to a specific word in Excel file using Python?

I am using pyexcelerator Python module to generate Excel files. I want to apply bold style to part of cell text, but not to the whole cell. How to do it?
Ashish
  • 430
  • 7
  • 13
4
votes
2 answers

xlwt - How to add page breaks to an Excel File?

I'm trying to add page breaks whenever a column's value changes in Excel using Python and xlwt. Does anyone know how to do this? I found one example but they don't really say if their code works, and they don't say what the numbers mean in the…
Greg
  • 45,306
  • 89
  • 231
  • 297
4
votes
3 answers

Adding links to another cell using the xlwt module for Python

I am exporting some information to an excel workbook using the awesome xlwt module for Python. I know that I can have a certain cell contain a hyperlink that points to an external site like this: from xlwt import Workbook, Formula wb =…
nooblar
  • 399
  • 1
  • 5
  • 12
4
votes
1 answer

Parse JSON to Excel - Pandas + xlwt

I'm kind of half way through this functionality. However, I need some help with formatting the data in the sheet that contains the output. My current code... response =…
LEE
  • 3,335
  • 8
  • 40
  • 70
4
votes
2 answers

ValueError: row index was 65536, not allowed by .xls format

Currently, I am trying to edit an existing excel file using xlwt. I do not want to edit directly on the excel, so I first make a copy. new_wb = xlutils.copy(file_location) From this copy, I used the xlwt module to write a new column into the newly…
Brian Kim
  • 65
  • 1
  • 2
  • 8
4
votes
3 answers

Adding a sheet to an existing excel worksheet without deleting other sheet

I am trying to add a sheet to the excel file: ex.xls and whenever I do it deletes all the previously made sheets. How do I add a sheet to this excel file without deleting the other sheets? Here is my code to create a sheet: import xlwt import…
Nick M.
  • 259
  • 1
  • 8
  • 22
4
votes
1 answer

PIL save as 24 bit true color bitmap

I have a png file generated by Gnuplot that I need to put into an excel document using XLWT. XLWT can't import PNG's into the document, only BMP's, so I needed to convert the PNG first. I used PIL for this. Here's the relevant code: im =…
Alpaca
  • 133
  • 2
  • 7