python - Execute function identified by name -


i'd run function identified string.

torun = 'testfunction'  def testfunction():     log.info('in function');  run(torun) 

where run whatever command need use. i've tried exec/eval without luck.

locals returns dict containing references in current scope

locals()[torun]() 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -