In my python script, I need to call within a for loop an executable, and waiting for that executable to write the result on the "output.xml".
How do I manage to use wait() & how do I know when one of my executable is finished generating the result to get the result? How do I close that process and open a new one to call again the executable and wait for the new result?
import subprocess
args = ("bin/bar")
popen = subprocess.Popen(args)
I need to wait for the output from "bin/bar" to generate the "output.xml" and from there, read it's content.
for index, result in enumerate(results):
myModule.callSubProcess(index)
#this is where the problem is.
fileOutput = open("output.xml")
parseAndStoreInSQLiteFileOutput(index, file)