Python eval() function
definition and usage
The eval() function calculates the specified expression, if the expression is a valid Python statement, it will be executed.
syntax
eval(expression, globals, locals)
parameter value
parameter | description |
---|---|
expression | A string that will be evaluated as Python code. |
globals | Optional. A dictionary containing global parameters. |
locals | Optional. A dictionary containing local parameters. |