P
Peter Otten
Traceback (most recent call last):Jerald said:Is it possible to exec() from within a function so the exec'd
code affects global?
For example
def foo():
exec ('X=[1,2,3]')
And I'd like 'X' to be a global variable.
.... exec "x = [1, 2, 3]" in globals()
....[1, 2, 3]
Peter