python中xlrd库实现文件读取的方法

  介绍

这篇文章给大家分享的是有关python中xlrd库实现文件读取的方法的内容。小编觉得挺实用的,因此分享给大家做个参考。一起跟随小编过来看看吧。

<强> python中xlrd读取思维导图: <强>

 python中xlrd库实现文件读取的方法

<强>

 python中xlrd库实现文件读取的方法

<强>

pip  install  xlrd

<强> <强>

import  xlrd   时间=xlsx  xlrd.open_workbook (& # 39; demo.xlsx& # 39;)   #,查看所有表列的表   打印(& # 39;All 表:,% & # 39;,%,xlsx.sheet_names ())   时间=sheet1  xlsx.sheets()[0], #,获得第1张表,索引从0开始   时间=sheet1_name  sheet1.name  #,获得名称   时间=sheet1_cols  sheet1.ncols  #,获得列数   时间=sheet1_nrows  sheet1.nrows  #,获得行数   打印(& # 39;Sheet1 名称:,% s \ nSheet1 关口:,% s \ nSheet1 行:,% & # 39;,%,(sheet1_name, sheet1_cols,, sheet1_nrows))

<强> <强>

[& # 39;ID_number& # 39;,, & # 39;状态# 39;,,& # 39;Create_Time& # 39;,, & # 39; Business_City& # 39;】   [& # 39;431381198109106573 & # 39;,,& # 39;有效& # 39;,,42725.0,& # 39;深圳市& # 39;】   [& # 39;431381198809122734 & # 39;,,& # 39;有效& # 39;,,42725.0,& # 39;深圳市& # 39;】   …   [& # 39;431381198901176911 & # 39;,,& # 39;有效& # 39;,,42725.0,& # 39;深圳市& # 39;】   [& # 39;43138119870827275 x # 39;,, & # 39;有效& # 39;,,42725.0,& # 39;深圳市& # 39;]

感谢各位的阅读!关于python中xlrd库实现文件读取的方法就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到吧!

python中xlrd库实现文件读取的方法