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

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
That's a little weird, and my running it works slightly differently. Please paste exactly what you're running (no time import and true being lowercase for example means we couldn't copy and paste it and have it immediately run) In your script, the main thread hits y.start() which completes

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.