Popen remote commands
<p>Looking to run the command: ssh user@some_host "echo 'some_sql' | /usr/bin/mysql -u some_args"</p>

<p>How would I do this using Popen?</p>

<pre><code>p1 = sp.Popen(["ssh", "user@some_host", "echo \"%s\"" % sql], stdout=sp.PIPE)
p2 = sp.Popen(["/usr/bin/mysql", "-u some_args"], stdin=p1.stdout, stdout=sp.PIPE)
</code></pre>

<p>Returns "OSError: [Errno 2] No such file or directory" since it's looking for /usr/bin/mysql on the local machine.</p>
