running two process simultaneously
<p>I'm trying to run 2 processes simultaneously, but only the first one runs </p>

<pre><code>def add():
    while True:
        print (1)
        time.sleep(3)

def sud():
     while True:
        print(0)
        time.sleep(3)

p1 = multiprocessing.Process(target=add) 
p1.run()
p = multiprocessing.Process(target=sud)
p.run()
</code></pre>

<p>The method you're looking for is <code>start</code>, not <code>run</code>. <code>start</code> starts the process and calls <code>run</code> to perform the work in the new process; if you call <code>run</code>, you run the work in the calling process instead of a new process.</p>

python multiprocessing