getting sheet names from openpyxl

后端 未结 3 996
天命终不由人
天命终不由人 2021-01-31 07:55

I have a moderately large xlsx file (around 14 MB) and OpenOffice hangs trying to open it. I was trying to use openpyxl to read the content, following this tutorial. The code sn

3条回答
  •  执笔经年
    2021-01-31 08:21

    python 3.x for get sheet name you must use attribute

    g_sheet=wb.sheetnames
    

    return by list

    for i in g_sheet:
        print(i)
    

    **shoose any name **

    ws=wb[g_sheet[0]]
    

    or ws=wb[any name] suppose name sheet is paster

    ws=wb["paster"]
    

提交回复
热议问题