D
Dotan Barak
Hi.
I'm trying to evaluate a string and getting a NameError
(it is expected, since the variable my_number wasn't provided in the
"locals" dictionary).
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 0, in ?
NameError: name 'my_number' is not defined
<--snip end-->
My question is: how can i know which variable name / symbol causes the
NameError exception?
In my example, this symbol is my_number.
Using that information, I will be able to print a nice error message to
the user.
Thanks
Dotan
I'm trying to evaluate a string and getting a NameError
(it is expected, since the variable my_number wasn't provided in the
"locals" dictionary).
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 0, in ?
NameError: name 'my_number' is not defined
<--snip end-->
My question is: how can i know which variable name / symbol causes the
NameError exception?
In my example, this symbol is my_number.
Using that information, I will be able to print a nice error message to
the user.
Thanks
Dotan