On Sun, May 10, 2015 at 7:39 PM, zipher <dreamingforw...@gmail.com> wrote: > Similarly, you'd want: > >>>> encode(codestr) > > to instantiate all objects in the codestr. You can't do this with eval, > because it doesn't allow assignment (eval(n=2) returns "InvalidSyntax").
Is exec what you're looking for? >>> exec('n = 2') >>> print(n) 2 -- https://mail.python.org/mailman/listinfo/python-list