0

Just wondering if there is an easy way to create a list of filenames from different values in a dictionary. For example:

thisdict = {
  "V": [20,40,60,80],
  "F": [0.1,0.2],
  "T": [4,3]
}
totalRuns = 1
for val in thisdict.keys():
    totalRuns = totalRuns*len(thisdict[val])

fileList = ['Run_Name']*totalRuns

The end goal to have a list of string outputs like:

Run_Name_20V_0.1F_4T, Run_Name_40V_0.1F_4T, Run_Name_60V_0.1F_4T, Run_Name_80V_0.1F_4T, Run_Name_20V_0.2F_4T, Run_Name_40V_0.2F_4T, Run_Name_60V_0.2F_4T, Run_Name_80V_0.2F_4T, Run_Name_20V_0.1F_3T, Run_Name_40V_0.1F_3T, Run_Name_60V_0.1F_3T, Run_Name_80V_0.1F_3T, Run_Name_20V_0.2F_3T, Run_Name_40V_0.2F_3T, Run_Name_60V_0.2F_3T, Run_Name_80V_0.2F_3T

Since we have 4 for V, 2 for F and 2 for T, we would want a list of size 16 (4x2x2)

Thanks!

0 Answers0