python -i (interactive environment)
JoeSalmeri at hotmail.com
Tue Mar 8 17:39:56 CET 2005
Thanks, I knew about that but my question is why is it not working
"Steven Bethard" <steven.bethard at gmail.com> wrote in message
news:09Wdncq9i4MjSbDfRVn-uA at comcast.com...
> Joe wrote:
>> Isn't this a bug?
>> Here's the test program:
>> import code
>> def test_func():
>> lv = 1
>> print '\n\nBEFORE lv: %s\n' % (lv)
>> print '\n\nAFTER lv: %s\n' % (lv)
> Check the documentation for locals() :
> "Update and return a dictionary representing the current local symbol
> table. Warning: The contents of this dictionary should not be modified;
> changes may not affect the values of local variables used by the
> So if you change things in the dictionary returned by locals() you won't
> actually change the local variables.
>  http://docs.python.org/lib/built-in-funcs.html#l2h-45
More information about the Python-list