import xlrd
iedb = {} # Empty dictionary
book = xlrd.open_workbook('sampledata.xls')
sh = book.sheet_by_index(0)
for i in range(1,sh.nrows): #skips fist line.
    iedb[sh.cell_value(rowx=i, colx=1)] = \
         sh.cell_value(rowx=i, colx=2)

This code is part of the book "Python for Bioinformatics", by Sebastian Bassi (sbassi@genesdigitales.com). Return to home page.