0

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?

2
  • 1
    You certainly cannot do that with os.system() - it doesn't return until the command finishes. subprocess.Popen() is what you want - you can read from the returned object's stdout attribute to get real-time output. Commented Mar 22, 2024 at 17:00
  • Please provide enough code so others can better understand or reproduce the problem. Commented Mar 25, 2024 at 6:16

0

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.