10.07.2015 Views

Automate Microsoft Office with Python - Mil-OSS

Automate Microsoft Office with Python - Mil-OSS

Automate Microsoft Office with Python - Mil-OSS

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Excel Automation• Lots of options• COM• ODBC• export as CSV, HTML• If using Excel file in read-onlymode, consider xlrd library.• Extract data from Excel spreadsheets (.xls and.xlsx, versions 2.0 onwards) on any platform.Pure <strong>Python</strong> (2.6 to 2.7). Strong support forExcel dates. Unicode-aware.import xlrdbook = xlrd.open_workbook(SOME_EXCEL_FILE_NAME)sheet = book.sheet_by_index(0) # first sheet# iterate row-by-rowfor row in range(sheet.nrows):# grab a single cellcell = sheet.cell_value(row, SOME_COLUMN_INDEX)GTRI_B-‹#›

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!