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