1import subprocess
2import signal
3
4..
5process = subprocess.Popen(..) # pass cmd and args to the function
6..
7process.send_signal(signal.SIGINT) # send Ctrl-C signal
8..
9stdout, stderr = process.communicate() # get command output and error
10..
11