import xlrd
coding=utf-8
class ReadExcel():
def __init__(self,fileName,sheetName):
workbook = xlrd.open_workbook(fileName)
self.sheet = workbook.sheet_by_name(sheetName)
def getValue(self,rowx,colx):
value = self.sheet.cell_value(rowx,colx)
if isinstance(value,float):
return int(value)
else:
return value
coding=utf-8
from dcs47.config.conf import *
from dcs47.public.ExcelRead import ReadExcel
url = ReadExcel(data_path,“Sheet1”).getValue(0,0)
username = ReadExcel(data_path,“Sheet1”).getValue(0,1)
username_error = ReadExcel(data_path,“Sheet1”).getValue(1,1)
password = ReadExcel(data_path,“Sheet1”).getValue(0,2)
password_error = ReadExcel(data_path,“Sheet1”).getValue(1,2)