IPython console not showing some outputs but showing others?
<p>Win 7, x64, Python 2.7, Anaconda 4.2.0, IPython 5.1.0</p>

<p>I am working through some <code>multiprocessing</code> tutorials &amp; hit a problem straight away whilst working in an IPython console. The code below...</p>

<pre><code>import multiprocessing

print 'hello'

def worker():
    """worker function"""
    print 'Worker'
    return


jobs = []
for i in range(5):
    p = multiprocessing.Process(target=worker)
    jobs.append(p)
    p.start()
</code></pre>

<p>I am expecting...</p>

<pre><code>hello
worker
worker
worker
worker
worker
</code></pre>

<p>but I am getting..</p>

<pre><code>hello
</code></pre>

<p>Why is the output from the <code>worker</code> function not being displayed in the IPython console?</p>

<p>EDIT: When run from the Anaconda command line it exits with a syntax error on the <code>print 'Worker'</code> line but when run from a Python console runs as expected if I keep pressing enter.</p>

<p>EDIT 2: Now works in Anaconda command window (I had the wrong Python installed). The issue appears not just limited to this code. Any print statement in any parallelized functions do not appear in the IPython console. </p>

<p>Try this:</p>

<pre><code>for i in range(5):
    p = multiprocessing.Process(target=worker)
    jobs.append(p)
    p.start()
    p.join()
</code></pre>

<p>I suspect that ipython is ending the child processes when the main process/function is done, and the <code>join</code> should help prevent that.</p>

python ipython python-multiprocessing