code: def pipecmd (cmd1, cmd2):
      
      p1 = subprocess.Popen(cmd1, stdout=subprocess.PIPE)
      p2 = subprocess.Popen(cmd2, stdin=p1.stdout, stdout=subprocess.PIPE)
      p1.stdout.close()  # Allow p1 to receive a SIGPIPE if p2 exits.
      return p2.communicate()[0]
docs: Return output of "cmd1 | cmd2".