I have called a python script within my PHP page using the code below:
echo shell_exec("python object_detection_tutorial_cmsc265.py");
The python script generates image files in a loop until a certain condition is met. Example is the code below:
while (True):
cv2.imwrite('image' + str(loop) + '.png',image);
if (not condition):
break
When the HTML/PHP page is exited in the browser, I can see that the images are still increasing in number, that means the python is still executing. How will I stop the python script upon exiting PHP page?