title: os.system vs subprocess in python on linux
body: <p>I have two python scripts. The first script calls a table of second scripts in which I need to execute a third party python script. It looks something like this: </p>
  
  <pre><code># the call from the first script. 
  cmd = "qsub -sync y -b -cwd -V -q long  -t 1-10 -tc 5 -N 'script_two' ./script2.py"
  
  script2thread = pexpect.spawn(cmd)
  
  # end of script 1 
  </code></pre>
  
  <p>So here i am sending 10 jobs out to the queue. In script 2 I have a case statement based on the task_id. In each one I make a similar call to the third party script using different parameters.  </p>
  
  <pre><code>...
  elif(task_id == 4)
  subprocess.call(./script3)
  
  # or 
  
  os.system(./script3 , shell=True)
  </code></pre>
  
  <p>This is where my question lies. Is there a difference/benefit to using one or the other? I know that on windows using one over the other makes a big difference because of support issues but I am on linux and have no intention of running this on windows.  Sometimes I get very weird results from using the subprocess, it cannot find other things on the network that it can when the third script is run independently one at a time. </p>