openpyxl

官方手册:
[https://openpyxl.readthedocs.io/en/stable/]
列号从数字变为字母
get_column_letter
列号从字母变为数字
column_index_from_string
from openpyxl.utils import get_column_letter,column_index_from_string

代码:
import openpyxl
wb = openpyxl.load_workbook("censuspopdata.xlsx")
sheetName = wb.get_sheet_by_name("Population by Census Tract")
row = sheetName.max_row()
print(row)
报错:
TypeError: 'int' object is not callable
解决方法:
max_row是属性不是函数,将括号去掉

你可能感兴趣的:(openpyxl)