How to extract a command from a string - python -
i have command this:
test = ('print( "it works!" )' )
and want use command inside of string. know how can extract , use it?
thank much, remus
use exec
make sure trust code, ie. don't run on user submitted code security reasons
>>> test = ('print( "it works!" )' ) >>> exec test works!
Comments
Post a Comment