Skip to content

Instantly share code, notes, and snippets.

@yankchina
Created May 20, 2014 03:20
Show Gist options
  • Save yankchina/2cbb14ea3fcfd9d8adea to your computer and use it in GitHub Desktop.
Save yankchina/2cbb14ea3fcfd9d8adea to your computer and use it in GitHub Desktop.
从XLS中读取信息,然后关闭该XLS文件
workbook = xlrd.open_workbook('1.xls')
sheet = workbook.sheet_by_index(0)
print sheet.nrows, sheet.ncols
teachers = []
for row_index in range(sheet.nrows):
teachers_name = sheet.cell_value(row_index,1)
teachers.append(teachers_name)
workbook.release_resources()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment