title: Python print output not appearing when called from bash
body: <p>Here is a minimal working example:</p>
  <p>I have a python script <code>test.py</code> that contains:</p>
  <pre class="lang-py prettyprint-override"><code>print(&quot;Hello&quot;)
  </code></pre>
  <p>and I have a bash script <code>test.sh</code> that calls that python function</p>
  <pre class="lang-sh prettyprint-override"><code>#!/usr/bin/bash
  python test.py
  </code></pre>
  <p>and when I run <code>test.sh</code> from terminal there is no output.</p>
  <p>Based on a few similar questions, I have tried appending <code>sys.stdout.flush</code> and calling <code>python -u</code> instead, but there is still no output.</p>
  <p>How do I get the output of <code>print</code> to show up?</p>
  <p><strong>Edit</strong></p>
  <p>In more complicated examples, how do I ensure that python print statements appear when called within a bash script? And ensure that those statements can be appropriately redirected with, e.g. <code>&amp;&gt;</code> operators?</p>
  <p>(Also, I tried searching for a while before asking, but couldn't find a question that addressed this exactly. Any links to more thorough explanations would be greatly appreciated!)</p>