Pretty much as the title says, I'm trying to run some execfile
calls but I am looking for a timeout option so that if my called script takes over ten seconds to run then it will kill the called script and continue...
The signal library/package is only for UNIX, I'm on windows so I'm a little stuck.
# Sequential wait to finish before moving onto the next script
try:
execfile("SUBSCRIPTS/TESTSCRIPT.py", {})
except Exception:
errors.write(traceback.format_exc() + '\n')
errors.write("\n\n")
# Semi-Sequential (Don't wait for it to finish before moving onto the third script)
subprocess.Popen(["pythonw", "SUBSCRIPTS/TEST.py", "0"], shell=True)
# Sequential wait to finish before moving onto the next script
try:
execfile("SUBSCRIPTS/TEST.py", {})
except Exception:
errors.write(traceback.format_exc() + '\n')
errors.write("\n\n")
# Sequential wait to finish before moving onto the next script
try:
execfile("SUBSCRIPTS/TESTSCRIPT.py", {})
except Exception:
errors.write(traceback.format_exc() + '\n')
errors.write("\n\n")
Any ideas?