how to operate the excel by python?
alex23
wuwei23 at gmail.com
Fri Jun 10 03:04:11 EDT 2005
ÒÊÃÉɽÈË wrote:
> i want to compare the content in excel,but i don't know whick module to use!
> can you help me?
I noticed a package on PyPi today that might be useful to you:
http://www.python.org/pypi/xlrd/0.3a1
The homepage is a little brief, so I clipped their example from the
README:
import xlrd
book = xlrd.open_workbook("myfile.xls")
print "The number of worksheets is", book.nsheets
print "Worksheet name(s):", book.sheet_names()
sh = book.sheet_by_index(0)
print sh.name, sh.nrows, sh.ncols
print "Cell D30 is", sh.cell_value(rowx=29, colx=3)
for rx in range(sh.nrows):
print sh.row(rx)
I haven't had cause to use it myself, however.
-alex23
More information about the Python-list
mailing list