def contrast_excel():
l_p = [] # 小表
wb_pri = xlrd.open_workbook('/Users/bunsuketake/Desktop/台账.xls') # 打开原始文件
sheet1 = wb_pri.sheet_by_name("Sheet1")
nrows = sheet1.nrows
wb_tar = xlrd.open_workbook('/Users/bunsuketake/Desktop/台账的副本.xls') # 打开目标文件
sheet2 = wb_tar.sheet_by_name("Sheet1")
nrows2 = sheet2.nrows
for i in range(1, nrows):
test01 = sheet1.row_values(i)
for j in range(1, nrows2):
test02 = sheet2.row_values(j)
l_p.append(test02)
if test01 not in l_p:
return False
else:
return True