title: Reading input for ssh from a file, using subprocess.Popen()
body: <p>I am attempting to call a handful of local bash scripts that I have written for health checking applications on remote servers. </p>
  
  <pre><code>ssh -q &lt;servername&gt; "bash -s" -- &lt; ./path/to/local/script.bash
  </code></pre>
  
  <p>The above runs perfectly fine from the command line. However, when I wrap the call in python, I keep getting errors stating: </p>
  
  <pre><code>bash: /path/to/file/script.bash: No such file or directory
  </code></pre>
  
  <p>As for my python, I am using the subprocess module.
  Python:</p>
  
  <pre><code>bashcmd="ssh -q %s \"bash -s\" -- &lt; ./%s" % (&lt;server&gt;,&lt;bashfilepath&gt;)
  process=subprocess.Popen(bashcmd.split, stdout=subprocess.PIPE)
  output, error = process.communicate()
  </code></pre>
  
  <p>Any help would be appreciated!</p>