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

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -