Re: expanding a variable to a dict

2008-04-09 Thread Max M
John Machin skrev: > On Apr 4, 9:44 am, Max M <[EMAIL PROTECTED]> wrote: > Ummm ... excessive apostrophes plus bonus gross syntax error, dood. > Did you try running any of these snippets??? No I just wanted to quickly show different ways to do it. The dicts in the original question wasn't dicts

Re: expanding a variable to a dict

2008-04-03 Thread John Machin
On Apr 4, 9:44 am, Max M <[EMAIL PROTECTED]> wrote: > idle skrev: > > > now I'd like to check them all for the existence of certain default > > keys; ie, if the dicts don't contain the keys, add them in with > > default values. > > > so, I've got: > > > for a in ['dictFoo','dictBar','dictFrotz']: >

Re: expanding a variable to a dict

2008-04-03 Thread Max M
idle skrev: > now I'd like to check them all for the existence of certain default > keys; ie, if the dicts don't contain the keys, add them in with > default values. > > so, I've got: > > for a in ['dictFoo','dictBar','dictFrotz']: > if hasattr(a,'srcdir') == False: > a['srcdir']='/u

Re: expanding a variable to a dict

2008-04-03 Thread Gary Herron
idle wrote: > brilliant. > Hardly. Any perceived brilliance is in the design of Python, not our simple and hopefully effective use of it. :-) Gary Herron > thanks to both of you. > -- http://mail.python.org/mailman/listinfo/python-list

Re: expanding a variable to a dict

2008-04-03 Thread idle
brilliant. thanks to both of you. -- http://mail.python.org/mailman/listinfo/python-list

Re: expanding a variable to a dict

2008-04-03 Thread John Machin
On Apr 4, 8:56 am, idle <[EMAIL PROTECTED]> wrote: > I've got a variable in a loop that I'm trying to expand/translate/ > readdress as an existing dict so as to add some keys into it.. > > eg; I have a set of existing dicts: dictFoo, dictBar, dictFrotz (names > changed to protect the innocent) > >

Re: expanding a variable to a dict

2008-04-03 Thread Arnaud Delobelle
On Apr 3, 10:56 pm, idle <[EMAIL PROTECTED]> wrote: > I've got a variable in a loop that I'm trying to expand/translate/ > readdress as an existing dict so as to add some keys into it.. > > eg; I have a set of existing dicts: dictFoo, dictBar, dictFrotz (names > changed to protect the innocent) > >

Re: expanding a variable to a dict

2008-04-03 Thread Gary Herron
idle wrote: > I've got a variable in a loop that I'm trying to expand/translate/ > readdress as an existing dict so as to add some keys into it.. > > eg; I have a set of existing dicts: dictFoo, dictBar, dictFrotz (names > changed to protect the innocent) > > now I'd like to check them all for the

expanding a variable to a dict

2008-04-03 Thread idle
I've got a variable in a loop that I'm trying to expand/translate/ readdress as an existing dict so as to add some keys into it.. eg; I have a set of existing dicts: dictFoo, dictBar, dictFrotz (names changed to protect the innocent) now I'd like to check them all for the existence of certain def