Sandra-24 wrote: > Is there a way in python to add the items of a dictionary to the local > function scope? i.e. var_foo = dict['var_foo']. I don't know how many > items are in this dictionary, or what they are until runtime.
Why do you want to do this? Exec and eval should -not- be used for this unless you are specifically creating a system allows arbitrary code execution. What's wrong with using a dictionary? It's much safer than allowing arbitrary names to be injected into a namespace. -- http://mail.python.org/mailman/listinfo/python-list