I have a script that is executed when a certain condition is met. I want to start another script that will do some calculations (and it must be in another script) and save the PID of that process. And then want ot check another condition. When the second condition is met I want to kill that script that I started earlier.
Can anybody allude me to some kind of solution please.
Example:
Script1.py
do some calculationmain_script.py
if [condition]:
create a process in background to call Script1.py
save PID of that process
if [another condition]:
kill that process