workbook = xlrd.open_workbook(filename='D:/Users/Administrator/Desktop/PY文件/新建 Microsoft Excel 工作表.xlsx')
sheet_names = workbook.sheet_names()
for sheet_name in sheet_names:
sheet = workbook.sheet_by_name(sheet_name)
hs = sheet.nrows
ls = sheet.ncols
# print(str(hs) + '行')
a = []
for x in range(ls):
a.append('')
for curr_row in range(0, hs):
if sheet.row_values(curr_row) == a:
print('是', sheet.row_values(curr_row))
else:
print('不', sheet.row_values(curr_row))
Python Excel找出某一行整行为空的那一行
最新推荐文章于 2023-03-13 11:09:52 发布