I am making a program which is an interface for a command-line application. When running the command-line app directly through CMD it opens a new window and shows the percentage complete. I want to get this percentage from the running application and get it into Python and then the interface. It doesn't need to use os.system(), as long as it can start the application (with parameters) then it doesn't matter how it does it.
I've looked here however, it only gets the output once the whole process has finished running. I've also looked here however this doesn't provide a solution and is very old. So is it possible to capture the output while it is still running at regular intervals?
os.system()- it doesn't return until the command finishes.subprocess.Popen()is what you want - you can read from the returned object'sstdoutattribute to get real-time output.