"James Stroud" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Depends on your namespace, but for the local namespace, you can use this:
>
> py> a = object()
> py> a
> <object object at 0x40077478>
> py> locals()['bob'] = a
> py> bob
> <object object at 0x40077478>

If you put this code within a function, it probably will not work. 
locals() is usually a *copy* of the local namespace and writes do not write 
back to the namespace itself.

tjr



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to