<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Sep 2, 2008 at 10:16 AM, topazcode <span dir="ltr"><<a href="mailto:ter@topazcode.com">ter@topazcode.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am using the subprocess module to run some shell commands on a Linux<br>
system:<br>
<br>
import subprocess<br>
output = subprocess.call('''ssh server1 "uptime"''', shell=True)<br>
<br>
The above assigns the output variable with a return code, i.e. 0 in<br>
this case. How can I actually capture the data returned from<br>
subprocess.call, rather than just the return code? I'd like to have<br>
the output variable contain the uptime string in this case. Any help<br>
is appreciated. Thanks.<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br><br><a href="http://docs.python.org/lib/node532.html">http://docs.python.org/lib/node532.html</a><br></div>