0

I would to run a command using popen, but I want to pipe the output to another method. My goal is to display a custom output: pipe the build output from compiling my project to a method which just outputs the progress percentage, and I also want to log the raw output to a file.

I don't want to have to wait for the subprocess to finish to be able to read its STDOUT.

Michael Ozeryansky
  • 7,204
  • 4
  • 49
  • 61
  • What have you tried so far? You can use the subprocess.PIPE and pass your subprocess's stdout pipe directly to something else... – Tom Dalton Nov 13 '16 at 18:48
  • I want the "something else" to be a method in my python program. I didn't want to create more scripts, and I want the process to remain all in my one python command. This is what I'm trying currently: http://stackoverflow.com/questions/4417546/constantly-print-subprocess-output-while-process-is-running/4417735#4417735 – Michael Ozeryansky Nov 13 '16 at 18:55
  • Not very clear what you mean - can you post some example code? – Tom Dalton Nov 13 '16 at 19:56

0 Answers0