Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
..
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #send #sigint #subprocess
ADD COMMENT
Topic
Name
4+5 =