There is a considerable amount of data on how to make progress bars in python (example). My question is the other way around; instead of providing data to the user, I want data from a progress bar.
I have a program (black box) which outputs its own progress in a progress bar form to stderr:
100% building index
12% creating mask
And the percentage is updated as it runs. I am calling this program using subp = subprocess.Popen(cmd)
.
It seems that the program's output is not explicitly buffered until a certain task reaches 100%. Using subprocess.PIPEs I was able to catch the output when a task reaches 100% but not while it is still running. Is it possible to catch the progress percentage continuously?