title: Convert string stored in string to a function (Python)
body: <p>If I have the name of a function stored in a string like so:</p>
  
  <p><em>foo = 'some_function'</em></p>
  
  <p>Assuming that I could call <em>bar.some_function.baz()</em>, how can I do that using foo? Obviously this example doesnt explain why I couldnt just use <em>some_function</em> but in the actual code I iterate over a list of names of functions that I want to call.</p>
  
  <p>To make it even clearer, if <em>bar.some_function.baz()</em> prints <em>'Hello world!'</em> then some code, using <em>foo</em> but not <em>some_function</em> should do the same. Is it perhaps possible to use the value of the string and <em>exec()</em>?</p>
  
  <p>Thanks in advance</p>