Skip to content

Instantly share code, notes, and snippets.

@enjoyksoo
Created August 31, 2015 11:09
Show Gist options
  • Save enjoyksoo/4c4f0cb9448a7e1a78a7 to your computer and use it in GitHub Desktop.
Save enjoyksoo/4c4f0cb9448a7e1a78a7 to your computer and use it in GitHub Desktop.
python_xlrd_2
__author__ = 'Administrator'
import xlrd
wb = xlrd.open_workbook("C:\\test.xlsx")
ws = wb.sheet_by_index(0)
ncol = ws.ncols
nlow = ws.nrows
print "-------- Sheet1 --------"
print "Number of col: " + str(ncol)
print "Number of low: " + str(nlow)
print "-------- Values of low --------"
i = 0
while i < nlow:
print str(ws.row_values(i))
i += 1
print "-------- Values of col --------"
i = 0
while i < ncol:
print str(ws.col_values(i))
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment