""""
读取excel文件
"""
import openpyxl
wb = openpyxl.load_workbook('example.xlsx')
names = wb.sheetnames
sheet = wb[names[0]]
maxRow = sheet.max_row
maxColumn = sheet.max_column
current_sheet = wb.active
current_name = sheet.title
a1 = sheet['A1'].value
a12 = sheet.cell(row=1, column=2).value
column_name = openpyxl.utils.cell.get_column_letter(1)
column_name_num = openpyxl.utils.cell.column_index_from_string('a')
"""
(<Cell 'Sheet1'.A1>, <Cell 'Sheet1'.B1>, <Cell 'Sheet1'.C1>)
(<Cell 'Sheet1'.A2>, <Cell 'Sheet1'.B2>, <Cell 'Sheet1'.C2>)
(<Cell 'Sheet1'.A3>, <Cell 'Sheet1'.B3>, <Cell 'Sheet1'.C3>)
(<Cell 'Sheet1'.A4>, <Cell 'Sheet1'.B4>, <Cell 'Sheet1'.C4>)
(<Cell 'Sheet1'.A5>, <Cell 'Sheet1'.B5>, <Cell 'Sheet1'.C5>)
"""
for one_column_data in sheet.iter_rows():
print(one_column_data[0].value)
"""
(<Cell 'Sheet1'.A1>, <Cell 'Sheet1'.A2>, <Cell 'Sheet1'.A3>)
(<Cell 'Sheet1'.B1>, <Cell 'Sheet1'.B2>, <Cell 'Sheet1'.B3>)
(<Cell 'Sheet1'.C1>, <Cell 'Sheet1'.C2>, <Cell 'Sheet1'.C3>)
"""
for one_row_data in sheet.iter_cols():
print(one_row_data[0].value, end="\t")
print("row = {}, column = {}".format(maxRow, maxColumn))