can I use this module to store output to a python variable?<br>I am looking for something similar to<br>commands.getoutput("<cmd>")<br><br><div class="gmail_quote">On Wed, Dec 2, 2009 at 11:42 AM, Chris Rebert <span dir="ltr"><<a href="mailto:clp2@rebertia.com">clp2@rebertia.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;"><div class="im">On Tue, Dec 1, 2009 at 10:05 PM, M Kumar <<a href="mailto:tomanishkb@gmail.com">tomanishkb@gmail.com</a>> wrote:<br>
> Is there any python module for windows which is equivalent to commands<br>
> module in linux?<br>
<br>
</div>`subprocess` should work: <a href="http://docs.python.org/library/subprocess.html" target="_blank">http://docs.python.org/library/subprocess.html</a><br>
<br>
The `commands` docs even say:<br>
"The subprocess module provides more powerful facilities for spawning<br>
new processes and retrieving their results.<br>
Using the subprocess module is preferable to using the commands module."<br>
<br>
Cheers,<br>
Chris<br>
<font color="#888888">--<br>
<a href="http://blog.rebertia.com" target="_blank">http://blog.rebertia.com</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>thanks & regards,<br><br>Maneesh KB<br>Sent from Delhi, DL, India