Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #12381
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <chris@rebertia.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.006 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'mrab': 0.04; 'terminated': 0.07; 'wrapper': 0.07; 'effect.': 0.09; 'suggestion.': 0.09; 'def': 0.15; 'control-c': 0.16; 'russ': 0.16; 'cc:addr:python- list': 0.16; 'mon,': 0.16; 'wrote:': 0.16; 'cheers,': 0.18; 'avoiding': 0.18; 'simpler': 0.18; 'cc:no real name:2**0': 0.20; 'seems': 0.20; 'cc:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'thus': 0.23; 'pm,': 0.24; 'aug': 0.24; 'guess': 0.26; 'suggestion': 0.26; 'bit': 0.28; 'exit': 0.29; 'message- id:@mail.gmail.com': 0.29; 'script': 0.29; 'cc:addr:python.org': 0.30; 'module': 0.30; 'outer': 0.30; 'sun,': 0.30; 'terminate': 0.30; 'thanks': 0.30; 'chris': 0.32; 'there': 0.33; 'that,': 0.33; 'idea': 0.34; 'switch': 0.35; 'instead.': 0.37; 'using': 0.37; 'put': 0.37; 'but': 0.37; 'two': 0.37; 'could': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'should': 0.38; 'subject:: ': 0.39; 'choose': 0.61; 'believe': 0.65; '29,': 0.67; 'sender:addr:chris': 0.84; 'received:209.85.218.46': 0.91; 'received:mail-yi0-f46.google.com': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=06G0HwEl8TH04IKz6fc6O4UknxYFKoicuiuy1v/oe7M=; b=R9zDg1QRVZd/EmWsow+BiYBlnZA/pycRiNgEyMl71cbjHWzrYBi0ogIBXfPNBLrv4K bwsjxAL27x7FeJ+QP90Z8h6QmQbNhcVDWmU5l1yoVqkihFGB/5XCoNW6GQ2kiCbdJmi7 eukypD2/Nb6Olb5OJAJ87K/9f4vKjNWzHdje4= |
| MIME-Version | 1.0 |
| Sender | chris@rebertia.com |
| In-Reply-To | <fd1e808a-7bc1-49dc-8a6c-eb0ca144abce@x11g2000prb.googlegroups.com> |
| 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 | Sun, 28 Aug 2011 20:16:17 -0700 |
| X-Google-Sender-Auth | vEMPjnrLQaeypKJHg4CbSzXQuLA |
| Subject | Re: killing a script |
| From | Chris Rebert <clp2@rebertia.com> |
| To | "Russ P." <russ.paielli@gmail.com> |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.532.1314587781.27778.python-list@python.org> (permalink) |
| Lines | 33 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1314587781 news.xs4all.nl 2479 [2001:888:2000:d::a6]:43186 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:12381 |
Show key headers only | View raw
On Sun, Aug 28, 2011 at 8:08 PM, 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.
Er, just write a wrapper for os.system(), e.g.:
def mysystem(cmd):
if os.system(cmd):
sys.exit()
Also, you may want to switch to using the `subprocess` module instead.
Cheers,
Chris
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