May-06-2019, 07:34 PM
(May-06-2019, 07:17 PM)slouw Wrote:Dict_Param['KeyStr[0]'] = AssignStr[0] Dict_Param['KeyStr[1]'] = AssignStr[1] Dict_Param['KeyStr[2]'] = AssignStr[2]
Remove the quotes, and that would work as you expect.
Or, you can do it the easy way and use a loop:
for index in range(len(KeyStr)): if index < len(AssignStr): key = KeyStr[index] val = AssignStr[index] Dict_Param[key] = val