its giving me following output :
2
<xlrd.sheet.Sheet object at 0xa24bf6c> #what does this mean??
<xlrd.sheet.Sheet object at 0xa2503ec> #what does this mean??
[u'Sheet 1', u'Sheet 2']
<xlrd.sheet.Sheet object at 0xa24bf6c> #what does this mean??
<xlrd.sheet.Sheet object at 0xa2503ec> ''
<xlrd.sheet.Sheet object at 0xa24bf6c> ''
<xlrd.sheet.Sheet object at 0xa2503ec> ''
the modules xlrd,xlutils,xlwt are installed properly.
i am using python2.6
Any help would be greatly appreciated!!
Thanks,
Niks
Bangalore, INDIA
That would be www.python-excel.org, I guess ... exactly where on the site?
> #!/usr/bin/python2.6
> from xlrd import open_workbook
> book = open_workbook('simple.xls')
> print book.nsheets
> for sheet_index in range(book.nsheets):
> print book.sheet_by_index(sheet_index)
> print book.sheet_names()
> for sheet_name in book.sheet_names():
> print book.sheet_by_name(sheet_name)
> for sheet in book.sheets():
> print sheet
>
>
> its giving me following output :
> 2
> <xlrd.sheet.Sheet object at 0xa24bf6c> #what does this mean??
It shows that you have an instance of the Sheet class that's defined in
the xlrd.sheet module and the instance's memory address is 0xa24bf6c.
This is standard behaviour in the case that the class doesn't provide a
specific __str__() or __repr__() method. Example:
>>> class Foo(object):
... pass
...
>>> a = Foo()
>>> print a
<__main__.Foo object at 0x00D84530>
>>> print str(a)
<__main__.Foo object at 0x00D84530>
>>> print repr(a)
<__main__.Foo object at 0x00D84530>
>>>
Cheers,
John