I'm trying to have a variable length nested for loop in python and to be able to reuse the variables.
for i in range(0,256):
for j in range(0,256):
for k in range(0,256):
...
myvar[i][j][k]...
In the code above, there's a hard coded nested for loops with a length of 3 for.
It should work like this:
for index[0] in range(0,256):
for index[1] in range(0,256):
for index[2] in range(0,256):
...
for index[n-1] in range(0,256):
for index[n] in range(0,256):
myvar[index[0]][index[1]][index[2]] ... [index[n-1]][index[n]] ...
for an arbitrary value of n