As you know, if we just do:
>>> a > 0 Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> a > 0 NameError: name 'a' is not defined
Is there a way to catch the exception / error and extract the value 'a' from it. I need this because I am exchanging dynamically generated expressions and would like to get names that are not defined in them.
I hope I get it. Thank you Manuel
python exception-handling expression dynamic-data nameerror
Manuel aráoz
source share