使用XLRD包识别Excel工作表单元格颜色代码-python,excel,xlrd-...
2016-08-19 13:48
2286 查看
使用XLRD包识别Excel工作表单元格颜色代码
使用XLRD包识别Excel工作表单元格颜色代码-python,excel,xlrd-...
我写一个python脚本来读取从Excelxlrd数据。几个工作表中的单元格突出显示不同的颜色,我想找出单元格的颜色代码。有没有办法做到这一点?一个例子将是非常赞赏。...
python excel
xlrd
我写一个python脚本来读取从Excel xlrd数据。几个工作表中的单元格突出显示不同的颜色,我想找出单元格的颜色代码。有没有办法做到这一点?一个例子将是非常赞赏。
本文地址 :CodeGo.net/374850/
-------------------------------------------------------------------------------------------------------------------------
1. 这里有一个方法来处理这个问题:
import xlrd book = xlrd.open_workbook("sample.xls", formatting_info=1) sheets = book.sheet_names() print "sheets are:", sheets for index, sh in enumerate(sheets): sheet = book.sheet_by_index(index) print "Sheet:", sheet.name rows, cols = sheet.nrows, sheet.ncols print "Number of rows: %s Number of cols: %s" % (rows, cols) for row in range(rows): for col in range(cols): print "row, col is:", row+1, col+1, thecell = sheet.cell(row, col) # could get 'dump', 'value', 'xf_index' print thecell.value, xfx = sheet.cell_xf_index(row, col) xf = book.xf_list[xfx] bgx = xf.background.pattern_colour_index print bgx
在Python中的Excel谷歌集团
本文标题 :使用XLRD包识别Excel工作表单元格颜色代码
本文地址
4000
:CodeGo.net/374850/
相关文章推荐
- python中使用xlrd读excel使用xlwt写excel的实例代码
- 使用C#和Excel进行报表开发(五)-操作单元格边框和颜色
- Python 使用 xlrd 读取 Excel格式文件
- Python:使用第三方库xlrd来读Excel
- python操作Excel读写--使用xlrd
- 使用C#和Excel进行报表开发(五)-操作单元格边框和颜色
- 使用C#和Excel进行报表开发(五)-操作单元格边框和颜色
- python操作Excel读写(使用xlrd和xlrt)
- 使用C#和Excel进行报表开发(五)-操作单元格边框和颜色
- python操作Excel读写--使用xlrd
- 使用C#和Excel进行报表开发(五)-操作单元格边框和颜色 【转】
- 使用C#和Excel进行报表开发(五)-操作单元格边框和颜色
- python操作Excel读写(使用xlrd和xlrt)
- 使用C#和Excel进行报表开发(五)-操作单元格边框和颜色
- python操作Excel读写(使用xlrd和xlrt)
- python操作Excel读写--使用xlrd
- Python 使用 xlrd 读取 Excel格式文件
- python操作Excel读写--使用xlrd(转)
- python操作Excel读写--使用xlrd
- 使用C#和Excel进行报表开发(五)-操作单元格边框和颜色