def convListToDict(list): if len(list) % 2 != 0: raise CL.ArgError("Invalid input list " + str(list)) retVal = [] while len(list) > 0: temp = [] key = list.pop(0) val = list.pop(0) temp.append(key) temp.append(val) retVal.append(temp) return dict(retVal)