Re: [Tutor] How to foreach over a dynamic number of levels

2009-02-12 Thread Kent Johnson
On Thu, Feb 12, 2009 at 1:04 PM, Alexander Daychilde (Gmail) wrote: >> Now what you want is the Cartesian product of all the lists. Python >> has a function (new in Python 2.6) in the itertools library module >> that will do this: > > I'm stuck on 2.5.2 because of the framework I'm driving... Doe

Re: [Tutor] How to foreach over a dynamic number of levels

2009-02-12 Thread Alexander Daychilde (Gmail)
First, thank you VERY much for your help! That's amazingly much easier than I thought it would be... I was considering looping through and generating nested for loops, then exec'ing the whole mess.. UGH, and security risk, to boot... Couple of questions: > Make a list containing all the steps: >

Re: [Tutor] How to foreach over a dynamic number of levels

2009-02-11 Thread Kent Johnson
On Wed, Feb 11, 2009 at 6:20 PM, Isaac Eiland-Hall wrote: > The group I'm working with has a python program (the Model Framework) that > runs data through a number of models. For each possible step, there are > multiple possible models. Each run also is for a single date. > > So the ini for Model