I use 'subprocess' to do work repeatedly like below.
import subprocess
arg_list = ['a', 'b', 'c', 'd']
for arg in arg_list:
proc = subprocess.Popen(['some_app.exe', arg])
proc.communicate()
Most of runs terminates successfully but occasionally the app requires to click the 'OK' button. Then the script gets stuck there. A working time varies very widely depending on arguments('a', 'b', ...) so that I cannot set proper a timeout.
Is there any method to get processes' status(working or waiting for button clicked)? If I can tell the app is waiting for clicking then can terminate the process.
Here is a similar question but no solution yet.