I\'m calling a function in Python which I know may stall and force me to restart the script.
How do I call the function or what do I wrap it in so that if it takes
#!/usr/bin/python2 import sys, subprocess, threading proc = subprocess.Popen(sys.argv[2:]) timer = threading.Timer(float(sys.argv[1]), proc.terminate) timer.start() proc.wait() timer.cancel() exit(proc.returncode)