I have a command like this:
test = ('print( "It works!" )' )
and I want to use the command which is inside of that string. Do you know how can I extract it and use it?
Thank you very much, Remus
Use exec but make sure you trust the code, ie. don't run this on user submitted code for security reasons
>>> test = ('print( "It works!" )' )
>>> exec test
It works!
test = "del __builtins__". It's short and sweet, and it cripples python - but not the computer, which is one of the things a real attacker would be trying to do.