What are you calling "the official xlrd documentation"? What does your
C:\Python25\Lib\site-packages\xlrd\doc\xlrd.html say about Sheet.col_values?
> However this raises an error as follows
>
> Traceback (most recent call last):
> File "C:/Python25/PS PRICE LIST/TestXLS.py", line 6, in <module>
> PakLabel = sh.col_values(2)
> AttributeError: 'Sheet' object has no attribute 'col_values'
Always show the full traceback; what you might assume is irrelevant is
not always so (see below).
>
> My code excerpt is the following:
>
> import xlrd
> book = xlrd.open_workbook("C:\Python25\PS PRICE LIST\RecPS.xls")
> sh = book.sheet_by_index(0)
> PakLabel = sh.col_values(2)
> PakValue = sh.col_values(3)
Not a problem this time, but always when you show the minimal code that
is supposed to demonstrate the problem, give the traceback and other
output from that code, not from some other code.
>
> I don't understand this error as everything work fine if I use
> row_values() in the same fashion as above.
> By the way, I'm running the code on windows xp and python 2.5 and
> microsoft excel 2003
Much more important: what version of xlrd are you running? Consider the
following:
=== latest public release ===
>>> import xlrd
>>> xlrd.__VERSION__
'0.6.1'
>>> bk = xlrd.open_workbook('palette_trial.xls')
>>> sh = bk.sheet_by_index(0)
>>> sh.col_values(1)[:6]
[u'Colour name', u'BLACK', u'WHITE', u'RED', u'GREEN [bright]', u'BLUE']
>>>
=== from HISTORY.html ===
Version 0.6.0a1, 2006-09-08
* Sheet objects have two new convenience methods: col_values(colx,
start_rowx=0, end_rowx=None) and the corresponding col_types. Suggested
by Dennis O'Brien.
=== previous public release ===
>>> import xlrd
>>> xlrd.__VERSION__
'0.5.2'
>>> bk = xlrd.open_workbook('palette_trial.xls')
>>> sh = bk.sheet_by_index(0)
>>> sh.col_values(1)[:6]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: Sheet instance has no attribute 'col_values'
>>>
My guess is that you followed some ancient link you found on the net.
Get the latest public release from http://pypi.python.org/pypi/xlrd or
http://www.lexicon.net/sjmachin/xlrd.htm ...
HTH,
John