Answers for "python send sigint to subprocess"

0

python send sigint to subprocess

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
..
Posted by: Guest on September-09-2021

Python Answers by Framework

Browse Popular Code Answers by Language