Skip to content

Instantly share code, notes, and snippets.

@i5on9i
Created June 7, 2016 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save i5on9i/8b373a69b976a77f14d7fa652fdae645 to your computer and use it in GitHub Desktop.
Save i5on9i/8b373a69b976a77f14d7fa652fdae645 to your computer and use it in GitHub Desktop.
def iterxlsx(sheet, startRow=0):
row = startRow
nrows = sheet.nrows
ncols = sheet.ncols
while row < nrows:
col = 0
colvals = []
while col < ncols:
cell = sheet.cell(row, col).value
colvals.append(cell)
col += 1
yield(colvals)
row += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment