I was trying to write script using python. i need to avoid repetition of the same tasks and want to write in one.
catlist1 = ['s0.05-k5-a1.0' , 's0.05-k5-a3.0' , 's0.05-k5-a7.0' , 's0.05-k5-a10.0' ]
catlist2 = ['s0.05-k7-a1.0' , 's0.05-k7-a3.0' , 's0.05-k7-a7.0' , 's0.05-k7-a10.0']
catlist3 = ['s0.07-k5-a1.0' , 's0.07-k5-a3.0' , 's0.07-k5-a7.0' , 's0.07-k5-a10.0' ]
catlist4 = ['s0.07-k7-a1.0' , 's0.07-k7-a3.0' , 's0.07-k7-a7.0' , 's0.07-k7-a10.0']
catlist = [catlist1 ,catlist2 ,catlist3 ,catlist4 ]
i need to call each list inside the for loop. i call all lists inside this single loop. I can do it repititvily by writing multiple times for i in catlist1 and again in catlist2 .. how could i solve this. thanks
for parName in catlist:
category = '/home/x/Desktop/rouge/ROUGE/Experiments/'
for root, subFolders, files in os.walk(category + parName):
#i = 0
(head, filename) = os.path.split(root)
print filename
#some function that is will re