首页 > 编程语言 > 详细

Python遍历excle

时间:2020-11-09 10:54:53      阅读:24      评论:0      收藏:0      [点我收藏+]

#遍历sheet1中所有行row
num_rows = worksheet1.nrows
for curr_row in range(num_rows):
row = worksheet1.row_values(curr_row)
print(‘row%s is %s‘ %(curr_row,row))


#遍历sheet1中所有列col
num_cols = worksheet1.ncols
for curr_col in range(num_cols):
col = worksheet1.col_values(curr_col)
print(‘col%s is %s‘ %(curr_col,col))


#遍历sheet1中所有单元格cell

for rown in range(num_rows):
for coln in range(num_cols):
cell = worksheet1.cell_value(rown,coln)
print cell

Python遍历excle

原文:https://www.cnblogs.com/HOWX/p/13946948.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!