title: Concatenate command of an external shell software in python
body: <p>I had a look in many different answers, but none of them solve my problem.</p>
  
  <p>I'm writing a python script to run an external software (written in fortran and compiled) that thakes itself some arguments.</p>
  
  <p>This is the structure of the folder:</p>
  
  <pre><code>a.out (-&gt; the compiled and running software)
  zbtest.lst
  zbtest.bud
  zbtest.nam
  </code></pre>
  
  <p>In a <em>normal</em> shell session, when running <code>./a.out</code> the program starts and ask me <strong>in sequence</strong> the <code>zbtest.lst</code>, <code>zbtest.bud</code>, <code>zbtest.nam</code> files.</p>
  
  <p>Now, how can I concatenate the command that runs the compiled software and give in sequence the file asked?</p>
  
  <p>Once in the correct directory and after reading many answers, I tried with:</p>
  
  <pre><code>import subprocess
  subprocess.Popen('./a.out ; zbtest.lst ; zbtest.bud ; zbtest.nam', shell = True)
  </code></pre>
  
  <p>but it seems that only the first argument is taken (<code>./a.out</code>). The prompt of the software runs well, but it keeps asking me the 3 files listed.</p>
  
  <p>I have no idea how to do that.. </p>
  
  <p>Thanks!</p>