In a python script named run_task.py, I start a p=Process(target=task) to do a task and record p=p.pid in a file. Then the main funct
run_task.py
p=Process(target=task)
p=p.pid