"Modulok" wrote
I would like to know how would I evaluate a string expression in python.
For example, if i say:
a = "3*2"
I want to do something to evaluate the variable 'a' to give me 6. How
can I do this?
[/snip]
The eval() function can do this:
eval("3*2")
WARNING: Long winded securi
[snip]
> I would like to know how would I evaluate a string expression in python.
> For example, if i say:
a = "3*2"
> I want to do something to evaluate the variable 'a' to give me 6. How
> can I do this?
[/snip]
The eval() function can do this:
eval("3*2")
WARNING: Long winded security