Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #68794 > unrolled thread

Re: terminate a program gracefully from a thread

Started byTerry Reedy <tjreedy@udel.edu>
First post2014-03-22 16:48 -0400
Last post2014-03-22 16:48 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: terminate a program gracefully from a thread Terry Reedy <tjreedy@udel.edu> - 2014-03-22 16:48 -0400

#68794 — Re: terminate a program gracefully from a thread

FromTerry Reedy <tjreedy@udel.edu>
Date2014-03-22 16:48 -0400
SubjectRe: terminate a program gracefully from a thread
Message-ID<mailman.8408.1395521304.18130.python-list@python.org>
On 3/22/2014 8:40 AM, Jabba Laci wrote:

> I have a script (see below) that I want to terminate after X seconds.
> The main loop of the program is waiting for user input.
> The program enters the main loop and I try to shut down the program
> after X seconds from a thread but I can't figure out how to do it. The
> program should also do some cleanup before termination, so the shut
> down must be graceful.

Although you have gotten comments specific to your problem, this type of 
thing should be easy (in just one thread) with asyncio (new in 3.4, 
backport on PyPI).

-- 
Terry Jan Reedy

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web