[mdione at grulic.org.ar: modifying locals]

dieter dieter at handshake.de
Wed Oct 14 01:58:04 EDT 2015


Marcos Dione <mdione at grulic.org.ar> writes:
> ...
> My problem is modifying the
> locals ...

In Python 2.7, I succeeded with the following code:

>>> def f():
...   x = 1
...   exec('x=2')
...   return x
... 
>>> f()
2





More information about the Python-list mailing list