|  |  | Python Library Reference |  |  |

Previous: 6.8.3.1 Replacing /bin/sh shell Up: 6.8.3 Replacing Older Functions Next: 6.8.3.3 Replacing os.system()

### 6.8.3.2 Replacing shell pipe line

    output=`dmesg | grep hda`
    ==>
    p1 = Popen(["dmesg"], stdout=PIPE)
    p2 = Popen(["grep", "hda"], stdin=p1.stdout)
    output = p2.communicate()[0]

|  |  | Python Library Reference |  |  |

Previous: 6.8.3.1 Replacing /bin/sh shell Up: 6.8.3 Replacing Older Functions Next: 6.8.3.3 Replacing os.system()

Release 2.4, documentation updated on 30 November 2004.