title: Executing shell command from python
body: <p>I am trying to compile a set of lines and execute them and append the output to text file. Instead of writing the same thing, I used a python script to compile and execute in background.</p>
  
  <pre><code>import subprocess
  subprocess.call(["ifort","-openmp","mod1.f90","mod2.f90","pgm.f90","-o","op.o"])
  subprocess.call(["nohup","./op.o","&gt;","myout.txt","&amp;"])
  </code></pre>
  
  <p>The program <code>pgm.f90</code> is getting compliled using the ifort compiler, but the ouput is not getting appended to <code>myout.txt</code>. Instead it is appending output to <code>nohup.out</code> and the program is <strong>not</strong> running in the background even after specifying <code>"&amp;"</code> in the python script. </p>
  
  <p>What obvious error have I made here? </p>
  
  <p>Thanks in advance </p>