Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. p1 = Popen(["dmesg"], stdout=PIPE)
  2. p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
  3. p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.
  4. output = p2.communicate()[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement