使用 Python 读取 xls 文件

Reading xls file with Python

import xlrd
cord = xlrd.open_workbook('MT_coordenadas_todas.xls')

id = cord.sheet_by_index(0)
print id

当我在终端中 运行 我的代码时,我得到了

<xlrd.sheet.Sheet object at 0x7f897e3ecf90>

我想使用第一列,那么我应该在我的代码中更改什么?

id 是对 sheet 对象的引用。您需要使用 values = id.col_values(0) 从 sheet 的第一列读取值。