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 interrupt, which means the >

RE: Threading Keyboard Interrupt issue

2019-05-29 Thread David Raymond
.org] On Behalf Of nihar Modi Sent: Wednesday, May 29, 2019 4:39 AM To: python-list@python.org Subject: Threading Keyboard Interrupt issue 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 th

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 interrupt and > just stops.

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: print('hello')