title: Passing python array to bash script (and passing bash variable to python function)
body: <p>I have written a Python module which contains functions that return arrays. I want to be able to access the string arrays returned from the python module, and iterate over in a bash script, so I may iterate over the array elements.</p>
  
  <p>For example:</p>
  
  <h1>Python module (mymod)</h1>
  
  <pre><code>def foo():
      return ('String', 'Tuple', 'From', 'Python' )
  
  def foo1(numargs):
      return [x for x in range(numargs)]
  </code></pre>
  
  <h1>Bash script</h1>
  
  <pre><code>foo_array  = .... # obtain array from mymod.foo()
  for i in "${foo_array[@]}"
  do
      echo $i
  done
  
  
  foo1_array = .... # obtain array from mymod.foo1(pass arg count from bash)
  for j in "${foo1_array[@]}"
  do
      echo $j
  done
  </code></pre>
  
  <p>How can I implement this in bash?.</p>
  
  <p><strong>version Info:</strong> </p>
  
  <p>Python 2.6.5
  bash: 4.1.5</p>