Python program to manage python script as child
Question: I am looking for a python equivalent of following:

    
    
    until python program.py; do 
        echo "Crashed...Restarting..." >&2
        sleep 1
    done
    

Also, I need to kill program.py when the parent program is killed. Any
suggestions?


Answer: Modules `subprocess` and `psutil` should provide most (if not all) you need.

    
    
    import sys, subprocess
    while True :
        retCode= subprocess.call(["python","program.py"])
        if retCode == 0 : break
        print('Crashed...Restarting...', file=sys.stderr )
    

