The easiest way to get the permutations of a list would be the permutations function, in the itertools module. So, if the algorithm is not binding, I would go with this:
from itertools import permutations
a = [1,2,3,4]
for item in permutations(a):
print item