Q:

Construct callable function from string

How to construct and call a function from a string?
For example, consider three different functions and a list of strings, I want to be able to use the items in list of strings to construct and call the appropriate function
def do_function1():
    return 'done function1'

def do_function2():
    return 'done function2'

def do_function3():
    return 'done function3'

listOfstr = ['function1','function2','function3']  

for item in listOfstr:
    result = 'do_'+item()
    print(result)

result = 'do_'+item()
TypeError: 'str' object is not callable

A:

The problematic code is
listOfstr = ['function1','function2','function3']  

for item in listOfstr:
    result = 'do_'+item()

In the first loop item, will have the value 'function1'. You are calling this string as if it were a function. But strings are not callable and have no code assigned to them!
Then, you go on with the for loop before doing anything.
Simply refer to item, like this:
for item in listOfstr:
    func_name = 'do_' + item
    func = globals()[func_name]
    func()

