How to restart a python script after it finishes
Try this:
os.execv(sys.executable, [sys.executable] + sys.argv)
You could wrap your script in a
while True:
...
block, or with a bash script:
while true ; do
yourpythonscript.py
done