Created
May 20, 2014 03:20
-
-
Save yankchina/2cbb14ea3fcfd9d8adea to your computer and use it in GitHub Desktop.
从XLS中读取信息,然后关闭该XLS文件
This file contains 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
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