sending ctrl C to a program
dale at riverhall.nospam.co.uk
Wed Mar 29 13:55:21 CEST 2006
s99999999s2003 at yahoo.com wrote:
> i have a program that works very similar to tail -f in Unix
> It will need a Ctrl-C in order to break out of the program.
> I wish to run this program using python (either thru os.system() or
> some other subprocess modules) and how can i pass Ctrl-C to this
> program to terminate it in python?
Isn't SIGINT the same as ctrl-c?
So something like
would send ctrl-c to process 1234.
If you just want the process to quit, you could probably just send it a
SIGTERM, which is signal 15.
Riverhall Systems - www.riverhall.co.uk
We're recruiting programmers. Please see the web site.
More information about the Python-list