title: using mpirun -np in python script
body: <p>I want to run a pw.x in bash with this command: mpirun -np 4 pw.x &lt; input.in through a python script. 
  I used this:</p>
  
  <pre><code>from subprocess import Popen, PIPE
  
  process = Popen( "mpirun -np 4 pw.x", shell=False, universal_newlines=True,
                    stdin=PIPE, stdout=PIPE, stderr=PIPE )
  output, error = process.communicate();
  print (output);
  </code></pre>
  
  <p>but it gives me this error:</p>
  
  <pre><code>Original exception was:
  Traceback (most recent call last):
    File "test.py", line 6, in &lt;module&gt;
      stdin=PIPE, stdout=PIPE, stderr=PIPE )
    File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
      restore_signals, start_new_session)
    File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'mpirun -np 4 pw.x': 'mpirun -np 4 pw.x'
  </code></pre>
  
  <p>How can I use "mpirun -np ..." in python scripts?</p>