For script in file use exec
For script in line use eval
!!! But !!!
Before using strings passed from an external source, check them out! Otherwise, you will find it possible to execute arbitrary code from within your program, so the range will check your variables!
You will never want to ask a question:
"Excuse me, Mom, will you really call your son Robert"), DROP TABLE students - "?
If you do not understand the link - see this quick cartoon ...
http://xkcd.com/327/
but when you are EVAL, you are solely responsible for the instructions you evaluate.
George Lambert
source share