workbook=xlrd.open_workbook(r'F:\visual studio 2010\QTAPI1.2\TEST_QTAPI1.2\TEST_QTAPI1.2\QT2.55.xlsx')
sheetId = workbook.sheet_by_name('Sheet1');#获取
测试用例所在的sheet
for row in range (1,sheetId.nrows):
if sheetId.cell(row,4).value.strip()!="": #过滤掉空的
excel TeatCaseargs=sheetId.cell(row,4).value
TeatCaseargs1=TeatCaseargs.split("\n")[0].split("#")[2] #提取有用参数SHFE 1#exchangeCode#SHFE
TeatCaseargs2=TeatCaseargs.split("\n")[1].split("#")[2]
TeatCaseargs3=TeatCaseargs.split("\n")[2].split("#")[2]
TeatCaseargs4=TeatCaseargs.split("\n")[3].split("#")[2]
TeatCaseargs5=TeatCaseargs.split("\n")[4].split("#")[2]
TeatCaseargs6=TeatCaseargs.split("\n")[5].split("#")[2]
TeatCaseargs7=TeatCaseargs.split("\n")[6].split("#")[2]
TeatCaseargs8=TeatCaseargs.split("\n")[7].split("#")[2]
TeatCaseargs9=TeatCaseargs.split("\n")[8].split("#")[2]
TeatCaseargs10=TeatCaseargs.split("\n")[9].split("#")[2]
TeatCaseId= sheetId.cell(row,0).value #提取用例编号
print TeatCaseargs