Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news.swapon.de!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'suppress': 0.09; 'cc:addr :python-list': 0.11; 'gui': 0.12; 'caching': 0.16; 'displaying': 0.16; 'invocation': 0.16; 'mode,': 0.16; 'subject:program': 0.16; 'thread,': 0.16; 'thanks,': 0.17; 'cc:addr:python.org': 0.22; 'load': 0.23; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'maybe': 0.34; 'subject:from': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'minutes,': 0.36; 'doing': 0.36; 'thanks': 0.36; 'hi,': 0.36; 'starting': 0.37; 'does': 0.39; 'either': 0.39; 'real': 0.63; 'quicker': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=IC0fby6UpszWoz+hyo5QaGH61LdB/UqbLoP7cEyzrgM=; b=dCO1z/hmaX+lYvMzCMVejv2/gqUdWKspf0md2sVmf1WNPhlokQKlkHUsENW5fhC1VW ksfVUCfY/760gWhRKDa+ce9qAKO6LxN3x0o3VM5yyKg8xSdW+jXRmSxMcY4roGn2QDYZ IGZ8JeoIOOuM9e3/WJkf7mmMuvZQDXf/Gos5XBcZZQr5PdvqwGDV79g/zMaiu4M96dEv c8ggVPaKzyzeuRwPlOviBUUy3a5sTmpYtTsmu/H5qgrDOFa5eZqhi9818Jec9ZhZ/gYI dfwflaRQUEVX0h2CxvY9rG2V8B8Gx0a2LyxZ8XTgiK+zDkfskCej+RhRzUfH+tkzeK4b nDRw== X-Received: by 10.182.200.131 with SMTP id js3mr17483700obc.0.1395494404235; Sat, 22 Mar 2014 06:20:04 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Jabba Laci Date: Sat, 22 Mar 2014 14:19:44 +0100 Subject: Re: terminate a program gracefully from a thread To: Dave Angel Content-Type: text/plain; charset=ISO-8859-1 Cc: Python mailing list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395494412 news.xs4all.nl 2965 [2001:888:2000:d::a6]:54545 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68772 > You need a flag to indicate that a particular invocation is the > dummy one (background). So use that same flag either to suppress > starting the thread, or to avoid the unwanted raw_input. > > Alternatively, rethink the need to preload at boot time. Any > caching the OS does is likely to only last a few minutes, > depending on load. So maybe you can make the real load seem to be > quicker by displaying the gui right away, but doing the > time-consuming part in a thread. Hi, Thanks for the idea. Right, if it's started in suicide mode, then there is no need to enter the raw_input. Thanks, Laszlo