Excel using win32com and python

前端 未结 3 1008
青春惊慌失措
青春惊慌失措 2021-01-01 08:15

I wanted to know how to read an entire column without iterating from an excel sheet using win32com client for python.

3条回答
  •  失恋的感觉
    2021-01-01 09:09

    Have you looked into the openpyxl library? From the documentation:

    from openpyxl import load_workbook
    wb = load_workbook(filename='file.xlsx')
    ws = wb.get_sheet_by_name(name='Sheet1')
    columns = ws.columns()
    

    There's also support for iterators and other goodies.

提交回复
热议问题