I am working on a python script, which requires reading values from a list in for loop and performing some operations on it. currently it looks like this:
for i in someList:
# do some operation here
Now, this particular operation takes hours to complete, so what i want to be able to do is use multi-threading/sub-processes and process multiple items in parallel. So is there a way that I can run the for loop like:
for i,j,k in someList:
#do some operation here
i know this syntax can be used to iterate over multiple lists simultaneously, but I want to be able to use multiple items of the same list. What i want from the loop is that the value of i,j and k update in the following manner:
i = someList[1], j = someList[2], k = someList[3]
in the next iteration:
i = someList[4], j = someList[5], k = someList[6]