Generating all combinations

Scott David Daniels Scott.Daniels at Acm.Org
Mon Jun 1 01:37:17 CEST 2009


member thudfoo wrote:
> On 5/31/09, Scott David Daniels <Scott.Daniels at acm.org> wrote:
>> Johannes Bauer wrote:
>>> I'm trying to write a function in Python which ...
>>  Look here:
>>   http://docs.python.org/library/itertools.html#itertools.product
>> (new in 2.6, but code works in lower versions).
> How would one go about installing the python 2.6 itertools code in python 2.5?

Either copy the code from the documentation for itertools.product
(_very_ easy), or go to the source for 2.6 and get a copy of
.../Lib/itertools.py and save as some other name in site-packages,
and try using that (I'd use some name like itertools_26).

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list