Re: [Tutor] Iterating over nested lists part2

2005-07-03 Thread Luis N
On 7/2/05, Kent Johnson <[EMAIL PROTECTED]> wrote: Luis N wrote:> def listItems():> l= []> d = {}> for r in range(len(vw)):> for x in range(lt):> ed = desc[x]> exec("d['%s']=vw[%d].%s" % (ed,r,ed)) > l.append(d)> print lIf I understand correct

Re: [Tutor] Iterating over nested lists part2

2005-07-02 Thread Kent Johnson
Luis N wrote: > def listItems(): > l= [] > d = {} > for r in range(len(vw)): > for x in range(lt): > ed = desc[x] > exec("d['%s']=vw[%d].%s" % (ed,r,ed)) > l.append(d) > print l If I understand correctly, you want to take all the rows of the

[Tutor] Iterating over nested lists part2

2005-07-02 Thread Luis N
Okay, This works great now: def listItems():     l= []     d = {}     for r in range(len(vw)):     for x in range(lt):     ed = desc[x]     exec("d['%s']=vw[%d].%s" % (ed,r,ed))     l.append(d)     print l But, it multiplies all of the records from vw by 5. How can I ha