OS specific command in Python

3c273 nospam at nospam.com
Wed Jun 21 12:10:08 EDT 2006


"Avell Diroll" <avelldiroll at yahoo.fr> wrote in message
news:4498d973$0$25496$626a54ce at news.free.fr...
> ##Python Script :
> from subprocess import Popen
> p1 = Popen(["dmesg"], stdout=PIPE)
> p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
> output = p2.communicate()[0]

I was just trying to learn how to use .communicate() and all of the examples
I see have [0] after .communicate(). What is the significance of the [0]?
Thanks for your help.
Louis





More information about the Python-list mailing list