commands module for windows

M Kumar tomanishkb at gmail.com
Wed Dec 2 01:46:39 EST 2009


thank you very much Chris :)

On Wed, Dec 2, 2009 at 12:10 PM, Chris Rebert <clp2 at rebertia.com> wrote:

> > On Wed, Dec 2, 2009 at 11:42 AM, Chris Rebert <clp2 at rebertia.com> wrote:
> >> On Tue, Dec 1, 2009 at 10:05 PM, M Kumar <tomanishkb at gmail.com> wrote:
> >> > Is there any python module for windows which is equivalent to commands
> >> > module in linux?
> >>
> >> `subprocess` should work:
> http://docs.python.org/library/subprocess.html
> >>
> >> The `commands` docs even say:
> >> "The subprocess module provides more powerful facilities for spawning
> >> new processes and retrieving their results.
> >> Using the subprocess module is preferable to using the commands module."
>
> On Tue, Dec 1, 2009 at 10:34 PM, M Kumar <tomanishkb at gmail.com> wrote:
> > can I use this module to store output to a python variable?
> > I am looking for something similar to
> > commands.getoutput("<cmd>")
>
> Yes, of course it can. If it's more powerful, then it can do
> everything the other module can.
> It'd be silly for the `commands` docs to point people to `subprocess`
> if this wasn't the case.
> It will take more than a single line of code though. Read the module's
> docs.
>
> Regards,
> Chris
> --
> http://blog.rebertia.com
>



-- 
thanks & regards,

Maneesh KB
Sent from Delhi, DL, India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091202/fb7d6c71/attachment-0001.html>


More information about the Python-list mailing list