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
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']:
>
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
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
brilliant.
thanks to both of you.
--
http://mail.python.org/mailman/listinfo/python-list
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)
>
>
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)
>
>
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
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