Multiple pipes in subprocess
To emulate the bash process substitution: #!/usr/bin/env python from subprocess import check_call check_call(‘someprogram <(someprocess) <(anotherprocess)’, shell=True, executable=”/bin/bash”) In Python, you could use named pipes: #!/usr/bin/env python from subprocess import Popen with named_pipes(n=2) as paths: someprogram = Popen([‘someprogram’] + paths) processes = [] for path, command in zip(paths, [‘someprocess’, ‘anotherprocess’]): with open(path, ‘wb’, 0) as pipe: … Read more