mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Corrected example for replacing shell pipeline. Fixes bug 1073790.
This commit is contained in:
parent
4871535cfe
commit
6fdf3cbb13
2 changed files with 2 additions and 2 deletions
|
@ -239,7 +239,7 @@ output = Popen(["mycmd", "myarg"], stdout=PIPE).communicate()[0]
|
||||||
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]
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ Replacing shell pipe line
|
||||||
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…
Add table
Add a link
Reference in a new issue