title: subprocess error in python
body: <p>I am trying to run a praat file from python itself with subprocess but python(subprocess) can't seem to find the directory. I don't understand why since when I run the command in terminal, it works perfectly fine. Cant anyone guide me to where I am going wrong? 
  This is the subprocess code </p>
  
  <pre><code>import silex
  import subprocess as sb
  cmd_line = raw_input()
  args = shlex.split(cmd_line)
  p = sb.Popen(args)
  </code></pre>
  
  <p>When I run it with the input</p>
  
  <pre><code>Praat /Users/admirmonteiro/tmp/tmp.praat
  </code></pre>
  
  <p>this is the error that I get : </p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;input&gt;", line 1, in &lt;module&gt;
    File "/Users/admirmonteiro/anaconda/lib/python2.7/subprocess.py", line 710, in __init__
      errread, errwrite)
    File "/Users/admirmonteiro/anaconda/lib/python2.7/subprocess.py", line 1335, in _execute_child
      raise child_exception
  OSError: [Errno 2] No such file or directory
  </code></pre>
  
  <p>As mentioned, I run the commands and they run fine in the terminal.
  I have also tried to run subprocess.call but the same error occurs. I have also tried with with shell=True as an argument but that also outputs the same error.
  Please Help ! </p>