<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex;">If vim is just an unfortunate example then it might be possible but I think<br>
we need to know a bit more about what exactly you are trying to do.<br><font color="#888888">
</font></blockquote></div><br>> It's actually  a stand alone program; which opens up a $EDITOR; an </div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">> then prints to stdout the results of some db munging.  ...</div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">> what I'm wanting to grab is the output printed to stdout after execution.  <br>

<br></div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">In that case use one of subprocesses predecessors, either os.popen </div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">or the command module. Either of these will start a subprocess and </div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">return stdout as a file like object.</div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br></div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">If you need to send input to the process via stdin you can use popen2</div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">and if you also need access to stderr you can use popen3 - you can </div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">see why they wanted to rationalise this with
 subprocess!</div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br></div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">HTH,</div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br></div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">Alan G.</div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br></div></div><div style="position:fixed"></div></div></body></html>