from openpyxl import load_workbook
work = load_workbook('500部豆瓣电影.xlsx')
sheet = work.active
# 读取 A 整列for cell in sheet['A']:print(cell.value)# 读取第一行for cell in sheet[1]:print(cell.value)# 读取所有行for row in sheet:print([cell.value for cell in row])
from openpyxl import load_workbook
work = load_workbook('500部豆瓣电影.xlsx')
sheet_names = work.sheetnames
sheet = work[sheet_names[1]]for row in sheet:
line =[cell.value for cell in row]print(line)