sending ctrl C to a process

Grant Edwards grante at visi.com
Wed Mar 29 06:12:59 CEST 2006


On 2006-03-29, s99999999s2003 at yahoo.com <s99999999s2003 at yahoo.com> wrote:
> hi
> thanks for the reply.

Please properly quote the article to which you're replying so
that we can tell who/what your talking to/about.

> Actually, i should clarify what i am doing. the program's
> output will be displayed to a web browser using cgi, so there
> is no keyboard interrupt. The backend cgi script (python
> script) will have to send Ctrl-C to break the program. 

Actually, you don't want to send a Ctrl-C to the program. You
want to send a SIGINT signal to the process.  That's what the
tty line-discipline layer in the tty driver sends to processes
attached to a tty when the tty receives the interrupt character
(which defaults to Ctrl-C).

Sending signals to processes is done using os.kill()

  http://docs.python.org/lib/os-process.html

-- 
Grant Edwards                   grante             Yow!  How do I get HOME?
                                  at               
                               visi.com            



More information about the Python-list mailing list