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
8
votes
4 answers

Move a worksheet in a workbook using openpyxl or xl* or xlsxwriter?

I've read the docs for, openpyxl, xlwt, xlrd, xlutils, xlsxwriter. I don't find a way to move a sheet in an Excel workbook. Tests added a worksheet to the ends. Concretely, I have a calendar of sorts, ['JAN','FEB',...,'DEC'] and I need to replace…
xtian
  • 2,765
  • 7
  • 38
  • 65
8
votes
2 answers

Setting an excel sheet in landscape mode from XLWT

I have a Python program that creates an excel sheet, but I have been asked by one of the users to modify it so that if he hits print it will print out to landscape mode, without him having to specify this. Is there some way to set the sheet to…
TimothyAWiseman
  • 14,385
  • 12
  • 40
  • 47
8
votes
1 answer

Python XLWT can not specify row height

I'm trying to use xlwt with row.(i).height, but I had no result. My Code: import xlwt book = xlwt.Workbook(encoding='latin-1') sheet = sheet.add_sheet('KPI.TiempoRespuesta',cell_overwrite_ok=True) sheet.write(1, 4,…
R. Stark
  • 177
  • 1
  • 2
  • 6
8
votes
1 answer

XLWT multiple styles

This has been bogging my mind with my current project. I'm trying to write styles into an excel sheet using XLWT, see below: sheet.write(rowi,coli,value,stylesheet.bold,stylesheet.bordered) I'm running into this error: TypeError: write() takes at…
Jon Hagelin
  • 137
  • 1
  • 1
  • 6
8
votes
2 answers

Python installing xlwt module error

I unzipped xlwt and tried to install from that directory, but I get the following error. >> python setup.py install Traceback (most recent call last): File "setup.py", line 4, in from xlwt import __VERSION__ File…
Mark Kennedy
  • 1,751
  • 6
  • 30
  • 53
8
votes
1 answer

Format individual characters in a single Excel cell with python

I am using xlrd, xlwt, and xlutils on the Windows Vista OS with Python 2.7. I have a set of DNA sequences in an excel worksheet that are 100 characters long, with each sequence in a single cell. I am trying to highlight characters at specific…
Brett Hanson
  • 83
  • 1
  • 4
7
votes
1 answer

Python Excel (xlrd, xlwt) - How to copy a style from one cell and put it on another

Specifically I'm trying to open an existing workbook, and write some data to it. However whenever I write the data it obliterates the borders on those cells. So I'm wondering if there's a way to copy the style of that cell before writing to it and…
Greg
  • 45,306
  • 89
  • 231
  • 297
7
votes
1 answer

Python Excel template read and re-write, maintaining formulae and formatting

I've run the gamut and can't seem to find what I'm looking for. All threads I found here end up in dead ends for me. xlrd, xlwt, and xlutils almost do what I need, but… The basic idea is that I need to use Python to write simple data (strings) to a…
user2141817
  • 71
  • 1
  • 1
  • 3
7
votes
1 answer

Can't export pandas dataframe to excel / encoding

I'm unable to export one of my dataframes due to some encoding difficulty. sjM.dtypes Customer Name object Total Sales float64 Sales Rank float64 Visit_Frequency float64 Last_Sale …
knightofni
  • 1,906
  • 3
  • 17
  • 22
7
votes
1 answer

xlwt - Print Range Settings

Summary: How do I set the print range settings from xlwt? I have a document that is currently set as four pages for the purposes of printing, and I need to make it so that the print range is set to only treat it as one page. The documentation for…
Havvy
  • 1,471
  • 14
  • 27
7
votes
1 answer

Python xlwt: preserve all styles but one

I'm using xlrd and xlwt to go through certain cells and check them for certain criteria. If they meet the criteria I move on, if not, I want to color the text RED. The formatting from cell to cell changes, some have a background color, some are…
scohe001
  • 15,110
  • 2
  • 31
  • 51
7
votes
7 answers

How to set color of text using xlwt

I haven't been able to find documentation on how to set the color of text. How would the following be done in xlwt? style = xlwt.XFStyle() # bold font = xlwt.Font() font.bold = True style.font = font # background color pattern =…
David542
  • 104,438
  • 178
  • 489
  • 842
7
votes
5 answers

Programatically creating a XLS with a drop down cell in Python

I am currently creating XLS files programatically using Python and the XLWT/XLRD libraries. I've been able to fill the cells with values and insert simple formulas. My challenge is that I want to create a drop down for my users…
pirhac
  • 887
  • 2
  • 8
  • 16
6
votes
2 answers

The ability to apply multiple formats to cell with xlwt / openpyxl

I plan to use one of 2 libraries below to output excel file in python: xlwt ( http://www.python-excel.org/ ) openpyxl ( http://packages.python.org/openpyxl/ ) I tried the first one, most of things seem to be fine but one issue, unfortunately it…
Quan
  • 473
  • 7
  • 16
6
votes
2 answers

Has anyone been able to write out UTF-8 characters using python's xlwt?

I'm trying to write data to an excel file that includes Japanese characters. I'm using codec.open() to get the data, and that seems to work fine, but I run into this error when I try to write the data: UnicodeEncodeError: 'ascii' codec can't encode…
StormShadow
  • 1,589
  • 4
  • 25
  • 33
1 2
3
42 43