import itertools
seq = [[1,2,3], [1,2,3], [1,2,3]]
for item in itertools.product(*[itertools.permutations(sublist) for sublist in seq]):
print item
结果:
((1, 2, 3), (1, 2, 3), (1, 2, 3))
((1, 2, 3), (1, 2, 3), (1, 3, 2))
((1, 2, 3), (1, 2, 3), (2, 1, 3))
((1, 2, 3), (1, 2, 3), (2, 3, 1))
((1, 2, 3), (1, 2, 3), (3, 1, 2))
((1, 2, 3), (1, 2, 3), (3, 2, 1))
((1, 2, 3), (1, 3, 2), (1, 2, 3))
((1, 2, 3), (1, 3, 2), (1, 3, 2))
((1, 2, 3), (1, 3, 2), (2, 1, 3))
((1, 2, 3), (1, 3, 2), (2, 3, 1))
((1, 2, 3), (1, 3, 2), (3, 1, 2))
((1, 2, 3), (1, 3, 2), (3, 2, 1))
((1, 2, 3), (2, 1, 3), (1, 2, 3))
((1, 2, 3), (2, 1, 3), (1, 3, 2))
((1, 2, 3), (2, 1, 3), (2, 1, 3))
((1, 2, 3), (2, 1, 3), (2, 3, 1))
((1, 2, 3), (2, 1, 3), (3, 1, 2))
((1, 2, 3), (2, 1, 3), (3, 2, 1))
((1, 2, 3), (2, 3, 1), (1, 2, 3))
((1, 2, 3), (2, 3, 1), (1, 3, 2))
((1, 2, 3), (2, 3, 1), (2, 1, 3))
((1, 2, 3), (2, 3, 1), (2, 3, 1))
((1, 2, 3), (2, 3, 1), (3, 1, 2))
((1, 2, 3), (2, 3, 1), (3, 2, 1))
((1, 2, 3), (3, 1, 2), (1, 2, 3))
((1, 2, 3), (3, 1, 2), (1, 3, 2))
((1, 2, 3), (3, 1, 2), (2, 1, 3))
((1, 2, 3), (3, 1, 2), (2, 3, 1))
((1, 2, 3), (3, 1, 2), (3, 1, 2))
((1, 2, 3), (3, 1, 2), (3, 2, 1))
((1, 2, 3), (3, 2, 1), (1, 2, 3))
((1, 2, 3), (3, 2, 1), (1, 3, 2))
((1, 2, 3), (3, 2, 1), (2, 1, 3))
((1, 2, 3), (3, 2, 1), (2, 3, 1))
((1, 2, 3), (3, 2, 1), (3, 1, 2))
((1, 2, 3), (3, 2, 1), (3, 2, 1))
((1, 3, 2), (1, 2, 3), (1, 2, 3))
((1, 3, 2), (1, 2, 3), (1, 3, 2))
((1, 3, 2), (1, 2, 3), (2, 1, 3))
((1, 3, 2), (1, 2, 3), (2, 3, 1))
((1, 3, 2), (1, 2, 3), (3, 1, 2))
((1, 3, 2), (1, 2, 3), (3, 2, 1))
((1, 3, 2), (1, 3, 2), (1, 2, 3))
((1, 3, 2), (1, 3, 2), (1, 3, 2))
((1, 3, 2), (1, 3, 2), (2, 1, 3))
((1, 3, 2), (1, 3, 2), (2, 3, 1))
((1, 3, 2), (1, 3, 2), (3, 1, 2))
((1, 3, 2), (1, 3, 2), (3, 2, 1))
((1, 3, 2), (2, 1, 3), (1, 2, 3))
((1, 3, 2), (2, 1, 3), (1, 3, 2))
((1, 3, 2), (2, 1, 3), (2, 1, 3))
((1, 3, 2), (2, 1, 3), (2, 3, 1))
((1, 3, 2), (2, 1, 3), (3, 1, 2))
((1, 3, 2), (2, 1, 3), (3, 2, 1))
((1, 3, 2), (2, 3, 1), (1, 2, 3))
((1, 3, 2), (2, 3, 1), (1, 3, 2))
((1, 3, 2), (2, 3, 1), (2, 1, 3))
((1, 3, 2), (2, 3, 1), (2, 3, 1))
((1, 3, 2), (2, 3, 1), (3, 1, 2))
((1, 3, 2), (2, 3, 1), (3, 2, 1))
((1, 3, 2), (3, 1, 2), (1, 2, 3))
((1, 3, 2), (3, 1, 2), (1, 3, 2))
((1, 3, 2), (3, 1, 2), (2, 1, 3))
((1, 3, 2), (3, 1, 2), (2, 3, 1))
((1, 3, 2), (3, 1, 2), (3, 1, 2))
((1, 3, 2), (3, 1, 2), (3, 2, 1))
((1, 3, 2), (3, 2, 1), (1, 2, 3))
((1, 3, 2), (3, 2, 1), (1, 3, 2))
((1, 3, 2), (3, 2, 1), (2, 1, 3))
((1, 3, 2), (3, 2, 1), (2, 3, 1))
((1, 3, 2), (3, 2, 1), (3, 1, 2))
((1, 3, 2), (3, 2, 1), (3, 2, 1))
((2, 1, 3), (1, 2, 3), (1, 2, 3))
((2, 1, 3), (1, 2, 3), (1, 3, 2))
((2, 1, 3), (1, 2, 3), (2, 1, 3))
((2, 1, 3), (1, 2, 3), (2, 3, 1))
((2, 1, 3), (1, 2, 3), (3, 1, 2))
((2, 1, 3), (1, 2, 3), (3, 2, 1))
((2, 1, 3), (1, 3, 2), (1, 2, 3))
((2, 1, 3), (1, 3, 2), (1, 3, 2))
((2, 1, 3), (1, 3, 2), (2, 1, 3))
((2, 1, 3), (1, 3, 2), (2, 3, 1))
((2, 1, 3), (1, 3, 2), (3, 1, 2))
((2, 1, 3), (1, 3, 2), (3, 2, 1))
((2, 1, 3), (2, 1, 3), (1, 2, 3))
((2, 1, 3), (2, 1, 3), (1, 3, 2))
((2, 1, 3), (2, 1, 3), (2, 1, 3))
((2, 1, 3), (2, 1, 3), (2, 3, 1))
((2, 1, 3), (2, 1, 3), (3, 1, 2))
((2, 1, 3), (2, 1, 3), (3, 2, 1))
((2, 1, 3), (2, 3, 1), (1, 2, 3))
((2, 1, 3), (2, 3, 1), (1, 3, 2))
((2, 1, 3), (2, 3, 1), (2, 1, 3))
((2, 1, 3), (2, 3, 1), (2, 3, 1))
((2, 1, 3), (2, 3, 1), (3, 1, 2))
((2, 1, 3), (2, 3, 1), (3, 2, 1))
((2, 1, 3), (3, 1, 2), (1, 2, 3))
((2, 1, 3), (3, 1, 2), (1, 3, 2))
((2, 1, 3), (3, 1, 2), (2, 1, 3))
((2, 1, 3), (3, 1, 2), (2, 3, 1))
((2, 1, 3), (3, 1, 2), (3, 1, 2))
((2, 1, 3), (3, 1, 2), (3, 2, 1))
((2, 1, 3), (3, 2, 1), (1, 2, 3))
((2, 1, 3), (3, 2, 1), (1, 3, 2))
((2, 1, 3), (3, 2, 1), (2, 1, 3))
((2, 1, 3), (3, 2, 1), (2, 3, 1))
((2, 1, 3), (3, 2, 1), (3, 1, 2))
((2, 1, 3), (3, 2, 1), (3, 2, 1))
((2, 3, 1), (1, 2, 3), (1, 2, 3))
((2, 3, 1), (1, 2, 3), (1, 3, 2))
((2, 3, 1), (1, 2, 3), (2, 1, 3))
((2, 3, 1), (1, 2, 3), (2, 3, 1))
((2, 3, 1), (1, 2, 3), (3, 1, 2))
((2, 3, 1), (1, 2, 3), (3, 2, 1))
((2, 3, 1), (1, 3, 2), (1, 2, 3))
((2, 3, 1), (1, 3, 2), (1, 3, 2))
((2, 3, 1), (1, 3, 2), (2, 1, 3))
((2, 3, 1), (1, 3, 2), (2, 3, 1))
((2, 3, 1), (1, 3, 2), (3, 1, 2))
((2, 3, 1), (1, 3, 2), (3, 2, 1))
((2, 3, 1), (2, 1, 3), (1, 2, 3))
((2, 3, 1), (2, 1, 3), (1, 3, 2))
((2, 3, 1), (2, 1, 3), (2, 1, 3))
((2, 3, 1), (2, 1, 3), (2, 3, 1))
((2, 3, 1), (2, 1, 3), (3, 1, 2))
((2, 3, 1), (2, 1, 3), (3, 2, 1))
((2, 3, 1), (2, 3, 1), (1, 2, 3))
((2, 3, 1), (2, 3, 1), (1, 3, 2))
((2, 3, 1), (2, 3, 1), (2, 1, 3))
((2, 3, 1), (2, 3, 1), (2, 3, 1))
((2, 3, 1), (2, 3, 1), (3, 1, 2))
((2, 3, 1), (2, 3, 1), (3, 2, 1))
((2, 3, 1), (3, 1, 2), (1, 2, 3))
((2, 3, 1), (3, 1, 2), (1, 3, 2))
((2, 3, 1), (3, 1, 2), (2, 1, 3))
((2, 3, 1), (3, 1, 2), (2, 3, 1))
((2, 3, 1), (3, 1, 2), (3, 1, 2))
((2, 3, 1), (3, 1, 2), (3, 2, 1))
((2, 3, 1), (3, 2, 1), (1, 2, 3))
((2, 3, 1), (3, 2, 1), (1, 3, 2))
((2, 3, 1), (3, 2, 1), (2, 1, 3))
((2, 3, 1), (3, 2, 1), (2, 3, 1))
((2, 3, 1), (3, 2, 1), (3, 1, 2))
((2, 3, 1), (3, 2, 1), (3, 2, 1))
((3, 1, 2), (1, 2, 3), (1, 2, 3))
((3, 1, 2), (1, 2, 3), (1, 3, 2))
((3, 1, 2), (1, 2, 3), (2, 1, 3))
((3, 1, 2), (1, 2, 3), (2, 3, 1))
((3, 1, 2), (1, 2, 3), (3, 1, 2))
((3, 1, 2), (1, 2, 3), (3, 2, 1))
((3, 1, 2), (1, 3, 2), (1, 2, 3))
((3, 1, 2), (1, 3, 2), (1, 3, 2))
((3, 1, 2), (1, 3, 2), (2, 1, 3))
((3, 1, 2), (1, 3, 2), (2, 3, 1))
((3, 1, 2), (1, 3, 2), (3, 1, 2))
((3, 1, 2), (1, 3, 2), (3, 2, 1))
((3, 1, 2), (2, 1, 3), (1, 2, 3))
((3, 1, 2), (2, 1, 3), (1, 3, 2))
((3, 1, 2), (2, 1, 3), (2, 1, 3))
((3, 1, 2), (2, 1, 3), (2, 3, 1))
((3, 1, 2), (2, 1, 3), (3, 1, 2))
((3, 1, 2), (2, 1, 3), (3, 2, 1))
((3, 1, 2), (2, 3, 1), (1, 2, 3))
((3, 1, 2), (2, 3, 1), (1, 3, 2))
((3, 1, 2), (2, 3, 1), (2, 1, 3))
((3, 1, 2), (2, 3, 1), (2, 3, 1))
((3, 1, 2), (2, 3, 1), (3, 1, 2))
((3, 1, 2), (2, 3, 1), (3, 2, 1))
((3, 1, 2), (3, 1, 2), (1, 2, 3))
((3, 1, 2), (3, 1, 2), (1, 3, 2))
((3, 1, 2), (3, 1, 2), (2, 1, 3))
((3, 1, 2), (3, 1, 2), (2, 3, 1))
((3, 1, 2), (3, 1, 2), (3, 1, 2))
((3, 1, 2), (3, 1, 2), (3, 2, 1))
((3, 1, 2), (3, 2, 1), (1, 2, 3))
((3, 1, 2), (3, 2, 1), (1, 3, 2))
((3, 1, 2), (3, 2, 1), (2, 1, 3))
((3, 1, 2), (3, 2, 1), (2, 3, 1))
((3, 1, 2), (3, 2, 1), (3, 1, 2))
((3, 1, 2), (3, 2, 1), (3, 2, 1))
((3, 2, 1), (1, 2, 3), (1, 2, 3))
((3, 2, 1), (1, 2, 3), (1, 3, 2))
((3, 2, 1), (1, 2, 3), (2, 1, 3))
((3, 2, 1), (1, 2, 3), (2, 3, 1))
((3, 2, 1), (1, 2, 3), (3, 1, 2))
((3, 2, 1), (1, 2, 3), (3, 2, 1))
((3, 2, 1), (1, 3, 2), (1, 2, 3))
((3, 2, 1), (1, 3, 2), (1, 3, 2))
((3, 2, 1), (1, 3, 2), (2, 1, 3))
((3, 2, 1), (1, 3, 2), (2, 3, 1))
((3, 2, 1), (1, 3, 2), (3, 1, 2))
((3, 2, 1), (1, 3, 2), (3, 2, 1))
((3, 2, 1), (2, 1, 3), (1, 2, 3))
((3, 2, 1), (2, 1, 3), (1, 3, 2))
((3, 2, 1), (2, 1, 3), (2, 1, 3))
((3, 2, 1), (2, 1, 3), (2, 3, 1))
((3, 2, 1), (2, 1, 3), (3, 1, 2))
((3, 2, 1), (2, 1, 3), (3, 2, 1))
((3, 2, 1), (2, 3, 1), (1, 2, 3))
((3, 2, 1), (2, 3, 1), (1, 3, 2))
((3, 2, 1), (2, 3, 1), (2, 1, 3))
((3, 2, 1), (2, 3, 1), (2, 3, 1))
((3, 2, 1), (2, 3, 1), (3, 1, 2))
((3, 2, 1), (2, 3, 1), (3, 2, 1))
((3, 2, 1), (3, 1, 2), (1, 2, 3))
((3, 2, 1), (3, 1, 2), (1, 3, 2))
((3, 2, 1), (3, 1, 2), (2, 1, 3))
((3, 2, 1), (3, 1, 2), (2, 3, 1))
((3, 2, 1), (3, 1, 2), (3, 1, 2))
((3, 2, 1), (3, 1, 2), (3, 2, 1))
((3, 2, 1), (3, 2, 1), (1, 2, 3))
((3, 2, 1), (3, 2, 1), (1, 3, 2))
((3, 2, 1), (3, 2, 1), (2, 1, 3))
((3, 2, 1), (3, 2, 1), (2, 3, 1))
((3, 2, 1), (3, 2, 1), (3, 1, 2))
((3, 2, 1), (3, 2, 1), (3, 2, 1))