方法一:
讀取指定列的內(nèi)容
def ReadCheckUrlOriData(sheetname):
listori = []
wb = openpyxl.load_workbook(excelpath)
checkUrlSheet = wb[sheetname] #打開指定sheet
#讀取數(shù)據(jù)到listori中
for row1 in range(2,500): #2,500是excel中數(shù)據(jù)的行
listori.append(checkUrlSheet.cell(row=row1,column=3).value)
return listori
方法二:
讀取整個excel的內(nèi)容
def ReadOriData(sheetname):
listori = []
wb = openpyxl.load_workbook(excelpath)
wsoridata = wb[sheetname] #原始數(shù)據(jù)sheet
# #讀取原始數(shù)據(jù)到listori中
for row in wsoridata.rows:
for cell in row:
listori.append(cell.value)
return listori