title: How to return values to korn shell from python?
body: <p>I have a korn shell script that calls in a Python script.<br>
  The Python script should return a variable length list of strings.<br>
  The ksh should capture those strings and do some more processing.<br><br>
  How do I return the list and capture it??</p>
  
  <p>My current code:</p>
  
  <p><strong>Python test.py:</strong></p>
  
  <pre><code>#!/usr/bin/python
  import sys
  
  list = [ 'the quick brown fox', 'jumped over the lazy', 'dogs' ]
  for s in list:
          print s
  </code></pre>
  
  <p><strong>Korn script test.ksh:</strong></p>
  
  <pre><code>#!/bin/ksh
  IFS=$'\n'
  echo $IFS
  
  for line in $(test.py)
  do
  echo "\nline:"
  echo "$line"
  done
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <blockquote>
    <p>test.ksh</p>
  </blockquote>
  
  <pre><code> \
  
  line:
  the quick brow
  
  line:
   fox
  jumped over the lazy
  dogs
  </code></pre>