您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

python 读取excel xlrd

2024/4/7 5:55:49发布23次查看
1. 去 https://pypi.python.org/pypi/xlrd/0.9.2下载xlrd-0.9.2.tar.gz 
2. 解压安装,笔者用的macos,直接python setup.py install 
3. 使用样例:
import xlrd book = xlrd.open_workbook(fn) #多少个sheet print "the number of worksheets is", book.nsheets #每个sheet的名字 print "worksheet name(s):", book.sheet_names() #得到第0个sheet sh = book.sheet_by_index(0) for rx in range(sh.nrows): values = sh.row(rx) for value in values: print value.ctype, value.value #type(number, text), value
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product