Re: [Tutor] slicing nested lists/dicts/tuples

2005-07-02 Thread Brian van den Broek
Luis N said unto the world upon 02/07/2005 07:51: > On 7/2/05, Luis N <[EMAIL PROTECTED]> wrote: > > Umm, sorry, I meant: > > d[desc[x]] = exec("""'vw[%s].desc[%s]'""" % (r,x )) > > > > > > __

Re: [Tutor] slicing nested lists/dicts/tuples

2005-07-02 Thread Luis N
On 7/2/05, Luis N <[EMAIL PROTECTED]> wrote: Umm, sorry, I meant: d[desc[x]] = exec("""'vw[%s].desc[%s]'""" % (r,x )) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] slicing nested lists/dicts/tuples

2005-07-02 Thread Luis N
Hi, Yes, sorry I haven't posted to the list in a while. I should have been more specific. I'm writing a simple contact database, using metakit as the backend. Thank you for pointing out that what I was trying to do was easier than I believed. Here's some code. db = metakit.storage('c:/addy.mk'

Re: [Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Reed L. O'Brien
Reed L. O'Brien wrote: >Luis N wrote: > > > >>Hi, >> >> >> >l > > >>[{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, >>{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}] >> >> >>This is how I imagine it: >> >>for i in l: >>for j in l

Re: [Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Reed L. O'Brien
Luis N wrote: > Hi, > > >>> l > [{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, > {'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}] > > > This is how I imagine it: > > for i in l: > for j in l[i]: > for k in l[i][j]: > print k.get('first')

Re: [Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Brian van den Broek
Luis N said unto the world upon 28/06/2005 15:25: > Hi, > > l > > [{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, {'last': > 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}] > > > This is how I imagine it: > > for i in l: > for j in l[i]: > for k in l[i][j]: >

[Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Luis N
Hi, >>> l [{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}] This is how I imagine it: for i in l:     for j in l[i]:         for k in l[i][j]:             print k.get('first')     print k.get('last') Is