Python - exec(expression, globals=None, locals=None) -


Python is shown as an example in the standard library:

  

code> X = 1 print (Eval ('x + 1') 2) A person can provide a more concise description with examples of both the globals and the use of disputes of local people.

globals and local to define it The scope in which eval should work, that is, what variable should be available in an attempt to evaluate the expression, for example:

  & gt; & Gt; & Gt;  x  

Note that the local version is used in the x x local and global region .


Comments