Corrected example "replacing shell pipe line".
This commit is contained in:
parent
293546a942
commit
61de19f122
|
@ -354,7 +354,7 @@ Replacing older functions with the subprocess module
|
||||||
output=`dmesg | grep hda`
|
output=`dmesg | grep hda`
|
||||||
==>
|
==>
|
||||||
p1 = Popen(["dmesg"], stdout=PIPE)
|
p1 = Popen(["dmesg"], stdout=PIPE)
|
||||||
p2 = Popen(["grep", "hda"], stdin=p1.stdout)
|
p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
|
||||||
output = p2.communicate()[0]
|
output = p2.communicate()[0]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue