Python script running twice
<p>Can somebody help me understand why is my code executed twice?</p>

<pre><code>import multiprocessing
from time import sleep
import os, signal

def neverEnding():
    while True:
        print ' Looping ... '
        sleep(3)


p = multiprocessing.Process(target=neverEnding)
p.start()

sleep(10)
print p.is_alive()

print p.pid
p.terminate()
print p.is_alive()
print 'terminated?'

os.kill(int(p.pid), signal.SIGTERM)
print 'Now?'
sleep(3)
print p.is_alive()
</code></pre>

<p>This is the output I'm getting.</p>

<pre><code> Looping ... 
 Looping ... 
 Looping ... 
 Looping ... 
True
8999
True
terminated?
Now?
False
 Looping ... 
 Looping ... 
 Looping ... 
 Looping ... 
True
9000
True
terminated?
Now?
False
</code></pre>

<p>I'm getting 'terminated?', 'Now?' etc... printed twice.<br>
Can somebody explain why does this happen?</p>

<p>Will the other processes running in the background cause this? (I had run the same script using subprocess before)</p>

<p>I'm using Ubuntu.</p>