Constantly monitor a program/process using Python
问题 I am trying to constantly monitor a process which is basically a Python program. If the program stops, then I have to start the program again. I am using another Python program to do so. For example, say I have to constantly run a process called run_constantly.py . I initially run this program manually, which writes its process ID to the file "PID" (in the location out/PROCESSID/PID). Now I run another program which has the following code to monitor the program run_constantly.py from a Linux