Created
November 22, 2015 06:18
-
-
Save jpibarra1130/f61ffa23b38513e4b2f3 to your computer and use it in GitHub Desktop.
Sample Python script to read from an excel file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xlrd | |
name = input('file: ') | |
wb = xlrd.open_workbook(name) | |
sheet = wb.sheet_by_index(0) | |
lookup = { | |
'name': 0, | |
'website': 1 | |
} | |
for rownumber in range(1, sheet.nrows): | |
print(rownumber) | |
row = sheet.row(rownumber) | |
name, website = row[lookup['name']].value, row[lookup['website']].value | |
print("Name: %s, Website: %s" % (name, website)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment