xlrd库的使用
后记: 获取行数和列数 是有数据的才会计算
参考: https://blog.csdn.net/herrygao/article/details/40046971
https://www.cnblogs.com/hedeyong/p/7646125.html
https://www.cnblogs.com/shenh/p/10382679.html
使用xlwt模块写入Excel文件才可以 醉了,妈蛋,下面文件才是最详细的
后记:
Python操作Excel的四个工具包
- xlrd: 对Excel进行读相关操作,注意只能操作 .xls
- xlwt: 对Excel进行写相关操作,注意只能操作 .xls,且只能创建一个全新的Excel然后进行写入和保存。 https://www.cnblogs.com/kaibindirver/p/11645127.html
- xlutils:对Excel进行读、写相关操作,注意只能操作 .xls
- openpyxl: 对Excel进行读、写相关操作,可操作 2010版的 .xlsx / .xlsm
工具包Python官网相关介绍文档
- xlrd: http://xlrd.readthedocs.io/en/latest/
- xlwt: http://xlwt.readthedocs.io/en/latest/
- xlutils: http://xlutils.readthedocs.io/en/latest/。 from xlutils.copy import copy;(b2c有用这个库造数据) https://www.cnblogs.com/machangwei-8/p/10739115.html
- openpyxl: http://openpyxl.readthedocs.io/en/latest/
来源: https://www.cnblogs.com/-brenda/p/8707627.html
后计:
xlrd新版无法读取xlsx文件
可以执行下面命令
sudo pip3 uninstall xlrd
sudo pip3 install xlrd==1.2.0
【推荐】100%开源!大型工业跨平台软件C++源码提供,建模,组态!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】Flutter适配HarmonyOS 5知识地图,实战解析+高频避坑指南
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步