import sys
from xlrd import open_workbook # xlrd用于读取xld
import xlwt # 用于写入xls
workbook = open_workbook(r'C:\Users\songsa\Desktop\maoyan_comment.xls') # 打开xls文件
sheet_name= workbook.sheet_names() # 打印所有sheet名称,是个列表
sheet = workbook.sheet_by_index(0) # 根据sheet索引读取sheet中的所有内容
sheet1= workbook.sheet_by_name('Sheet1') # 根据sheet名称读取sheet中的所有内容
print(sheet.name, sheet.nrows, sheet.ncols) # sheet的名称、行数、列数
content = sheet.col_values(7) # 第六列内容
print(content)