I have a python script that starts a program and automates through it, continuously processing new data and saves to a pre-set directory.
What is the recommended way to run the Python script forever, logging errors when they occur, and restarting when it crashes?
so far I've came across the os.execv and have this to start:
import sys
import os
def pyexcept(t, v, tb):
import traceback
## restarts the script
os.execv( sys.executable, '')
but I often get stuck trying to figure out the next step, could someone explain the next steps i could take, ty!