Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #12424
| References | <22a0dae6-8a60-4e68-82a5-31a949bd69d5@y8g2000prd.googlegroups.com> <mailman.528.1314582745.27778.python-list@python.org> <e52d78f9-7adb-4046-9368-3d35c5b20d0b@m4g2000pri.googlegroups.com> <mailman.530.1314586278.27778.python-list@python.org> <fd1e808a-7bc1-49dc-8a6c-eb0ca144abce@x11g2000prb.googlegroups.com> |
|---|---|
| Date | 2011-08-29 23:53 +0100 |
| Subject | Re: killing a script |
| From | Arnaud Delobelle <arnodel@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.560.1314658396.27778.python-list@python.org> (permalink) |
On 29 August 2011 04:08, Russ P. <russ.paielli@gmail.com> wrote: > On Aug 28, 7:51 pm, Chris Angelico <ros...@gmail.com> wrote: >> On Mon, Aug 29, 2011 at 12:41 PM, Russ P. <russ.paie...@gmail.com> wrote: >> > On Aug 28, 6:52 pm, MRAB <pyt...@mrabarnett.plus.com> wrote: >> >> You could look at the return value of os.system, which may tell you the >> >> exit status of the process. >> >> > Thanks for the suggestion. Yeah, I guess I could do that, but it seems >> > that there should be a simpler way to just kill the "whole enchilada." >> > Hitting Control-C over and over is a bit like whacking moles. >> >> I believe the idea of this suggestion is for the outer script to >> notice that the inner script terminated via Ctrl-C, and would then >> immediately choose to terminate itself - thus avoiding the >> whack-a-mole effect. >> >> ChrisA > > Yes, but if I am not mistaken, that will require me to put a line or > two after each os.system call. That's almost like whack-a-mole at the > code level rather than the Control-C level. OK, not a huge deal for > one script, but I was hoping for something simpler. I was hoping I > could put one line at the top of the script and be done with it. Write a function! That's what they're for after all :) -- Arnaud
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
killing a script "Russ P." <russ.paielli@gmail.com> - 2011-08-28 18:15 -0700
Re: killing a script MRAB <python@mrabarnett.plus.com> - 2011-08-29 02:52 +0100
Re: killing a script "Russ P." <russ.paielli@gmail.com> - 2011-08-28 19:41 -0700
Re: killing a script Chris Angelico <rosuav@gmail.com> - 2011-08-29 12:51 +1000
Re: killing a script "Russ P." <russ.paielli@gmail.com> - 2011-08-28 20:08 -0700
Re: killing a script Chris Rebert <clp2@rebertia.com> - 2011-08-28 20:16 -0700
Re: killing a script "Russ P." <russ.paielli@gmail.com> - 2011-08-28 20:22 -0700
Re: killing a script "Russ P." <russ.paielli@gmail.com> - 2011-08-29 14:26 -0700
Re: killing a script Thomas Jollans <t@jollybox.de> - 2011-08-29 09:49 +0200
Re: killing a script Arnaud Delobelle <arnodel@gmail.com> - 2011-08-29 23:53 +0100
Re: killing a script Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-08-30 14:13 +1000
Re: killing a script Hans Mulder <hansmu@xs4all.nl> - 2011-08-30 12:40 +0200
Re: killing a script Cameron Simpson <cs@zip.com.au> - 2011-09-09 10:03 +1000
Re: killing a script Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-09 19:07 +1000
Re: killing a script Hans Mulder <hansmu@xs4all.nl> - 2011-09-09 12:13 +0200
Re: killing a script Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-09 22:16 +1000
Re: killing a script Cameron Simpson <cs@zip.com.au> - 2011-09-10 08:29 +1000
Re: killing a script Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-10 11:25 +1000
Re: killing a script Chris Angelico <rosuav@gmail.com> - 2011-09-10 11:37 +1000
Re: killing a script Cameron Simpson <cs@zip.com.au> - 2011-09-10 18:49 +1000
Re: killing a script Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-11 15:08 +1000
Re: killing a script Nobody <nobody@nowhere.com> - 2011-09-10 10:47 +0100
Re: killing a script Paul Rubin <no.email@nospam.invalid> - 2011-08-28 19:53 -0700
Re: killing a script Nobody <nobody@nowhere.com> - 2011-08-29 07:52 +0100
csiph-web