Python background shell script communication
<p>I have 2 python scripts, <code>foo.py</code> and <code>bar.py</code>. I am running foo.py in the background using</p>

<pre><code>python foo.py &amp;
</code></pre>

<p>Now I want to run <code>bar.py</code> and use the stdout from this file to trigger script inside foo.py. Is this possible? I'm using Ubuntu 16.04 LTS.</p>

<p>There is a system that actually comes from UNIX world that creates <code>pipes</code> between processes. A pipe is basically a pair of file descriptors, each program having access to one of them. One program writes to the pipe, while the other reads:</p>

<p><a href="https://docs.python.org/2/library/subprocess.html" rel="nofollow">https://docs.python.org/2/library/subprocess.html</a></p>

<p>However, this requires an aditional script where you start foo and bar as subprocesses and connect their outputs/inputs.</p>

python shell background-process