title: store return value of a Python script in a bash script
body: <p>I want to execute a python script from a bash script, and I want to store the output of the python script in a variable. </p>
  
  <p>In my python script, I print some stuff to screen and at the end I return a string with:</p>
  
  <pre><code>sys.exit(myString) 
  </code></pre>
  
  <p>In my bash script, I did the following:</p>
  
  <pre><code>outputString=`python myPythonScript arg1 arg2 arg3 `
  </code></pre>
  
  <p>But then when I check the value of <code>outputString</code> with <code>echo $outputString</code> I get everything that the Python script had printed to screen, but <em>not</em> the return value <code>myString</code>!</p>
  
  <p>How should I do this?</p>
  
  <p>EDIT: I need the string because that tells me where a file created by the Python script is located. I want to do something like:</p>
  
  <pre><code>fileLocation=`python myPythonScript1 arg1 arg2 arg1`
  python myPythonScript2 $fileLocation
  </code></pre>