0

I am using "subprocess" to execute a .exe file from a Python script. I need to do this in a loop, ie start the .exe, run it for a minute, kill it, do it all over again.

I am using subprocess.check_call to execute it with arguments, but I don't know how to stop it.

0

1 Answer 1

0

subprocess.check_call is used to check the returned value - use subprocess.Popen this returns a process ID, (pid), which can be used after your time limit with pid.terminate() to end the process, (kill it).

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.