一. 进行读出excel信息
1. 打印出 excel 中的工作表数 和 行列数
from pathlib import Path
from xlrd import open_workbook
def read_excel(file):
workbook = open_workbook(file)
print('工作表数量:', workbook.nsheets,workbook.sheets())
for worksheet in workbook.sheets(): # 循环输出表名
row = worksheet.nrows
print("Worksheet name:", worksheet.name, "\tRows:", row, "\tColumns:", worksheet.ncols)
my_file = Path('all_info.xls')
print(my_file,my_file.is_file())