小编cad*_*ena的帖子

如何在 XLWings 中引用 Excel 表格列名称?

XLWings 是否允许我通过表和列名称与 Excel 表格(在 Excel 2007 及更高版本中通过菜单或 ctrl+t 提供)进行交互?这确实存在于年轻的开源项目 Pyvot ( https://pypi.python.org/pypi/Pyvot ) 中。我希望 XLWings 现在可以实现这一点,或者 XLWings 将添加该功能,特别是因为这个开源项目可以作为模型使用。

这是来自https://pythonhosted.org/Pyvot/tutorial.html的示例。“Pyvot 专门识别表和自动过滤器中的列名称。Pyvot 将在工作簿中的所有表中搜索给定的列名称。” 下面的示例会将“城市”列中可见单元格的值返回到列表。

import xl
wb = xl.Workbook(r"c:\temp\cities.xlsx")
wb.get("City").get() #get the column named City
Run Code Online (Sandbox Code Playgroud)

python excel excel-2010 xlwings

3
推荐指数
1
解决办法
5007
查看次数

标签 统计

excel ×1

excel-2010 ×1

python ×1

xlwings ×1