netinvent / command_runner

Substitute for subprocess that handles all hassle that comes from different platform and python versions, and allows live stdout and stderr capture for background job/interactive GUI programming ;)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document piping runners into each other

frank-lenormand opened this issue · comments

Hi,

Apologies if I’ve missed it in the documentation.

Would it be possible to explain/illustrate how it would be possible to effectively execute a pipeline, with command_runner?

Example (made up): zcat in.txt.gz | tee -a out.txt | less.

I get that there’s a way to create queues, and potentially use those to redirect them to runners, but I don’t quite see a simple way of implementing the above.

Thanks!

command_runner opens a process, and attaches it's stdout/stderr to it in order to get necessary info back.
What you want is opening a process, which will get stdout/stderr from the subprocesses it will open.
Guess you want to run command_runner with shell=True argument which does exactly this ;)

Btw, next command_runner version will also support binding stdin directly to a process, in order to pipe some output directly into your python script which will pass it to the process command_runner opens.