title: Calling a Python function from a shell script
body: <p>I am trying to figure out how to call a Python function from a shell script.</p>
  
  <p>I have a Python file with multiple functions and I need to use the values returned by them in my shell script. Is there a way to do it.</p>
  
  <p>I am doing this in order to read a config file using Python and getting the values in shell. Is there any other better way to achieve this.</p>
  
  <p><code>test.py</code> contains:</p>
  
  <pre><code>import ConfigParser
  
  config = ConfigParser.ConfigParser()
  config.read("test.conf")
  
  def get_foo():
      return config.get("locations", "foo")
  
  def get_bar():
      return config.get("locations", "bar")
  </code></pre>
  
  <p>I need to store the values returned by the Python functions in a shell variable.</p>