Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
TypeError when trying to change the column width
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bea  
View profile   Translate to Translated (View Original)
 More options Aug 16 2012, 12:30 pm
From: Bea <beatka.sta...@gmail.com>
Date: Thu, 16 Aug 2012 09:30:28 -0700 (PDT)
Local: Thurs, Aug 16 2012 12:30 pm
Subject: TypeError when trying to change the column width

Hello All,

I'm new to this forum and relatively new to Python.
I'm trying to run simple script to change the column width and I'm getting
this error message. Could you please advice me where could be the root of
this issue?

import xlwt
wb = xlwt.Workbook()
ws = wb.add_sheet('Account Manager')
ws.write(0,0,'Account Number')
ws.col(0).width = len('Account Number') * 256
wb.save('widthtest.xls')

Traceback (most recent call last):
  File "C:/_My Docs/Scripts/Python Scripts/Excel/column_width.py", line 6,
in <module>
    wb.save('widthtest.xls')
  File "C:\Python27\lib\site-packages\xlwt\Workbook.py", line 657, in save
    doc.save(filename, self.get_biff_data())
  File "C:\Python27\lib\site-packages\xlwt\Workbook.py", line 642, in
get_biff_data
    data = sheet.get_biff_data()
  File "C:\Python27\lib\site-packages\xlwt\Worksheet.py", line 1312, in
get_biff_data
    self.__colinfo_rec(),
  File "C:\Python27\lib\site-packages\xlwt\Worksheet.py", line 1150, in
__colinfo_rec
    result += self.__cols[col].get_biff_record()
  File "C:\Python27\lib\site-packages\xlwt\Column.py", line 36, in
get_biff_record
    return ColInfoRecord(self._index, self._index, self.width,
self._xf_index, options, self.unused).get()
TypeError: __init__() takes exactly 6 arguments (7 given)

Thank you in advance!
Bea


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Machin  
View profile  
 More options Aug 19 2012, 3:45 am
From: John Machin <sjmac...@lexicon.net>
Date: Sun, 19 Aug 2012 00:45:20 -0700 (PDT)
Local: Sun, Aug 19 2012 3:45 am
Subject: Re: TypeError when trying to change the column width

On Friday, August 17, 2012 2:30:28 AM UTC+10, Bea wrote:

>   File "C:\Python27\lib\site-packages\xlwt\Column.py", line 36, in
> get_biff_record
>     return ColInfoRecord(self._index, self._index, self.width,
> self._xf_index, options, self.unused).get()
> TypeError: __init__() takes exactly 6 arguments (7 given)

> You appear to have  a damaged installation of xlwt ... Column.py is from

the latest (0.7.4) version but BiffRecords.py (which contains the
ColInfoRecord class being instantiated by the above code) can only be from
an earlier version. I suggest that you delete every file in C:\Python27\lib\site-packages\xlwt,
then get version 0.7.4 from PyPI (http://pypi.python.org/pypi/xlwt/) and
install it.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bea  
View profile   Translate to Translated (View Original)
 More options Aug 22 2012, 5:19 am
From: Bea <beata.sta...@cremeglobal.com>
Date: Wed, 22 Aug 2012 02:19:33 -0700 (PDT)
Local: Wed, Aug 22 2012 5:19 am
Subject: Re: TypeError when trying to change the column width

Thank you for your advice. I'll reinstall my xlwt then.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »