Re: Threading Keyboard Interrupt issue

2019-05-29 Thread eryk sun
On 5/29/19, Dennis Lee Bieber wrote: > > In the OP's example code, with just one thread started, the easiest > solution is to use > > y.start() > y.join() > > to block the main thread. That will, at least, let the try/except catch the > interrupt. It does not, however, kill the s

Re: Threading Keyboard Interrupt issue

2019-05-29 Thread eryk sun
On 5/29/19, David Raymond wrote: > > Keyboard interrupts are only received by the main thread, which in this case > completes real quick. > > So what happens for me is that the main thread runs to completion instantly > and leaves nothing alive to receive the keyboard interrup

RE: Threading Keyboard Interrupt issue

2019-05-29 Thread David Raymond
leaves nothing alive to receive the keyboard interrupt, which means the loop thread will run forever until killed externally. (Task manager, ctrl-break, etc) In this case, even if the main thread _was_ still alive to catch the keyboard interrupt, that exception does not get automatically passed

Re: Threading Keyboard Interrupt issue

2019-05-29 Thread Chris Angelico
On Thu, May 30, 2019 at 1:45 AM nihar Modi wrote: > > I have written a simple code that involves threading, but it does not go to > except clause after Keyboard interrupt. Can you suggest a way out. I have > pasted the code below. It does not print 'hi' after keyboard inte

Threading Keyboard Interrupt issue

2019-05-29 Thread nihar Modi
I have written a simple code that involves threading, but it does not go to except clause after Keyboard interrupt. Can you suggest a way out. I have pasted the code below. It does not print 'hi' after keyboard interrupt and just stops. import threading def loop(): while true: pr

Re: KeyBoard interrupt and Redirection operator

2009-09-15 Thread Dave Angel
aditya shukla wrote: Hello Guys, I have a program which i use like this scraps.py arg1 arg2 > filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is running and as generate an error messag

Re: KeyBoard interrupt and Redirection operator

2009-09-15 Thread Gary Herron
aditya shukla wrote: Hello Guys, I have a program which i use like this scraps.py arg1 arg2 > filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is running and as generate an error me

Re: KeyBoard interrupt and Redirection operator

2009-09-15 Thread Gabriel Genellina
En Tue, 15 Sep 2009 15:10:48 -0300, aditya shukla escribió: I have a program which i use like this scraps.py arg1 arg2 > filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is runn

KeyBoard interrupt and Redirection operator

2009-09-15 Thread aditya shukla
Hello Guys, I have a program which i use like this scraps.py arg1 arg2 > filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is running and as generate an error message and exit as I use a k

Re: keyboard "interrupt"

2008-03-27 Thread John Fisher
Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > John Fisher wrote: > > Hi Group, > > Hi John > > > I have been absent a while, mainly because I have been getting better at > > figuring out my own Python problems. But not this one... > > > > I have a timed loop performing certain tasks until a tota

Re: keyboard "interrupt"

2008-03-19 Thread Hans Georg Krauthäuser
On 18 Mrz., 22:18, [EMAIL PROTECTED] (John Fisher) wrote: > Hi Group, > > I have been absent a while, mainly because I have been getting better at > figuring out my own Python problems. But not this one... > > I have a timed loop performing certain tasks until a total period of > time has elapsed.

Re: keyboard "interrupt"

2008-03-18 Thread Arnaud Delobelle
John Fisher wrote: > Hi Group, Hi John > I have been absent a while, mainly because I have been getting better at > figuring out my own Python problems. But not this one... > > I have a timed loop performing certain tasks until a total period of > time has elapsed. I would like to be able to in

keyboard "interrupt"

2008-03-18 Thread John Fisher
Hi Group, I have been absent a while, mainly because I have been getting better at figuring out my own Python problems. But not this one... I have a timed loop performing certain tasks until a total period of time has elapsed. I would like to be able to interrupt the loop or set various flags dur