Error
I downloaded Python and this is the result. input: from xlrd import open_workbook wb = open_workbook('Book2.xls') values = [] for s in wb.sheets(): #print 'Sheet:',s.name for row in range(1, s.nrows): col_names = s.row(0) col_value = [] for name, col in zip(col_names, range(s.ncols)): value = (s.cell(row,col).value) try : value = str(int(value)) except : pass col_value.append((name.value, value)) values.append(col_value) print (values) Output: Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from xlrd import open_workbook Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named xlrd >>> >>> wb = open_workbook('Book2.xls') Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'open_workbook' is not defined >>> values = [] >>> for s in wb.sheets(): ... #print 'Sheet:',s.name ... for row in range(1, s.nrows): ... col_names = s.row(0) ... col_value = [] ... for name, col in zip(col_names, range(s.ncols)): ... value = (s.cell(row,col).value) ... try : value = str(int(value)) ... except : pass ... col_value.append((name.value, value)) ... values.append(col_value) ... print (values) File "<stdin>", line 12 print (values) ^ SyntaxError: invalid syntax >>>