📅  最后修改于: 2022-03-11 14:46:27.538000             🧑  作者: Mango
import subprocess
import signal
..
process = subprocess.Popen(..) # pass cmd and args to the function
..
process.send_signal(signal.SIGINT) # send Ctrl-C signal
..
stdout, stderr = process.communicate() # get command output and error
..