Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to run shell command ctrl + c in python script

# Pressing Ctrl-C sends a SIGINT signal to your program. 
# You can do that yourself from the command line with "kill INT xxxx" 
# where xxxx is the PID of the program.

import os
import signal

os.kill(p.pid,signal.SIGINT)
Source by www.raspberrypi.org #
 
PREVIOUS NEXT
Tagged: #run #shell #command #ctrl #python #script
ADD COMMENT
Topic
Name
8+9 =