def getInfoOfInputFile(input_file_path):
global info
info = []
temp = {}
getInfo = pd.read_excel(os.path.join(os.getcwd()+'\\input', input_file_path), sheet_name="frequency_plan", dtype=str, keep_default_na=False)
columns = getInfo.columns.size # 列
rows = getInfo.iloc[:, 0].size # 行
for i in range(0, rows):
temp['MAINFLOW'] = getInfo['MAINFLOW'][i]
temp['SUBFLOW'] = getInfo['SUBFLOW'][i]
temp['TESTSTUITE'] = getInfo['TESTSTUITE'][i]
temp['SPEC'] = getInfo['SPEC'][i]
temp['TESTMOTHED'] = getInfo['TESTMOTHED'][i]
temp['PARA'] = ''
for j in range(5, columns): # parameters start from column 6
if(getInfo.iat[i, j] == ''):
pass
else:
temp['PARA'] += ((getInfo.iat[i, j])+'\n\t\t\000')
print(temp['PARA'])
print("*******************************")
info.append(copy.deepcopy(temp))
# return info
python 读取excel 按表头 hash 存入并保存在list copy.deepcopy
最新推荐文章于 2023-03-02 17:53:54 发布