#!/bin/bash # Kill the process A # Do something... # Start the process A subprocess.Popen("./script.sh")