Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p1 = Popen(["dmesg"], stdout=PIPE)
- p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
- p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.
- output = p2.communicate()[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement