2

I'm using popen to run a subprocess in python. I need to read each line the subprocess outputs as it is being outputted, rather then getting everything once the process terminates. I've tried everything I could find on Google with no success. Any help would be greatly appreciated.

1

1 Answer 1

1

The subprocess.Popen documentation describes the available arguments to its call.

You want to set the bufsize argument to 1 (line-buffered input/output).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.