import time
from multiprocessing import Process
def possible_error_causer(a, b):
time.sleep(5)
c = a / b
print(c)
time.sleep(100)
for i in range(3):
p = Process(target=possible_error_causer, args=(i, i))
p.start()
The code above will execute after an exception occured in process that received 0, 0 as arguments (will run 100 seconds after that). But I want script to stop when there is error in any process. Try except is not an option (sys.exit() in except), because it doesn't catch all external errors (eg it doesn't catch some OpenCV errors)