What is the correct way to invoke a command containing multiple pipes to Popen so that its output can be read? I tried:
Popen(shlex.split("mycmd arg1 | mysecondcmd - | thirdcmd -", stdout=PIPE)")
But I don’t believe shlex.split is right here. What’s the correct syntax?
You have a few options — You can pass
shell=True:Or, you can break it up into a bunch of
Popencalls hooking their stdout to the next Popen’s stdin as demonstrated in the documentation.