只需使用以下
nth配方
itertools
>>> from itertools import permutations, islice>>> def nth(iterable, n, default=None): "Returns the nth item or a default value" return next(islice(iterable, n, None), default)>>> print nth(permutations(range(10), 10), 1000)(0, 1, 2, 4, 6, 5, 8, 9, 3, 7)



