Skip to content

Instantly share code, notes, and snippets.

@agyeiarcher
Created March 16, 2018 17:00
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 agyeiarcher/a121875f739bfe665ca042575faca0be to your computer and use it in GitHub Desktop.
Save agyeiarcher/a121875f739bfe665ca042575faca0be to your computer and use it in GitHub Desktop.
xlrd: Connect to a Database
from xlrd import open_workbook
wb = open_workbook('simple.xls')
for s in wb.sheets():
print 'Sheet:',s.name
for row in range(s.nrows):
values = []
for col in range(s.ncols):
values.append(s.cell(row,col).value)
print ','.join(values)
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment