📜  python 发送 sigint 到子进程 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:27.538000             🧑  作者: Mango

代码示例1
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
..