Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-20 Thread Rhamphoryncus
On Jun 19, 11:09 pm, Brendon Costa <[EMAIL PROTECTED]> wrote: > > If only the main thread can receive KeyboardInterrupt, is there any > > reason why you couldn't move the functionality of the Read thread into > > the main thread? It looks like it's not doing any work, just waiting > > for the Proc

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-19 Thread Brendon Costa
> If only the main thread can receive KeyboardInterrupt, is there any > reason why you couldn't move the functionality of the Read thread into > the main thread? It looks like it's not doing any work, just waiting > for the Proc thread to finish. > > You could start the Proc thread, do the current

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-19 Thread MRAB
On Jun 19, 7:54 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 18 Jun 2008 21:33:42 -0700 (PDT), Brendon Costa > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > Unfortunately that is the problem. It is blocking in a IO system call > > and i want to force it to exi

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-19 Thread Brendon Costa
I tested this a bit more. My windows example was incorrect. It should have used CTRL_C_EVENT. But even then, the problem is that the process will also close the console window from which it was called because of the 0. Also this requires that the process actually have a console and is not a GUI app

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Brendon Costa
I tested this a bit more. My windows example was incorrect. It should have used CTRL_C_EVENT. But even then, the problem is that the process will also close the console window from which it was called because of the 0. Also this requires that the process actually have a console and is not a GUI app

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Brendon Costa
> I don't know the "standard" way, but perhaps you can get some ideas from > this recent > thread:http://groups.google.com/group/comp.lang.python/browse_thread/thread/... > I had a quick read through that thread. I think i will need some more time to think about what they are saying in there thou

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Gabriel Genellina
En Wed, 18 Jun 2008 21:39:41 -0300, Brendon Costa <[EMAIL PROTECTED]> escribió: I have a small python project i am working on. Basically i always have two threads. A "Read" thread that sits in a loop reading a line at a time from some input (Usually stdin) and then generating events to be proc

How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Brendon Costa
Hi all, I have a small python project i am working on. Basically i always have two threads. A "Read" thread that sits in a loop reading a line at a time from some input (Usually stdin) and then generating events to be processed and a "Proc" thread that processes incoming events from a queue. There