I want to use python to execute shell commands, how to get the process ID of the process generated by the shell command.
import subprocess
subprocess.Popen(['{}'.format(self.executor), '-c', {}'.format(config), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
The process executed by this shell command does not exit by itself, I need to run 10 min to KILL it, how can I get the id of the process?