I have a string variable with the exact name of a function, e.g.
ran_test_opt = \"random_aoi\"
The function looks like this:
Sure, you can use globals:
globals
func_to_run = globals()[ran_test_opt] func_to_run()
Or, if it is in a different module, you can use getattr:
getattr
func_to_run = getattr(other_module, ran_test_opt) func_to_run()