You should use subprocess.PIPE , also to separate this command, you should use shlex.split() to prevent strange behavior in some cases:
from subprocess import Popen, PIPE from shlex import split p1 = Popen(split("tar -c mydir"), stdout=PIPE) p2 = Popen(split("md5sum"), stdin=p1.stdout)
But to create an archive and create its checksum, you must use the Python built-in tarfile and hashlib instead of calling shell commands.
Mattoufoutu
source share