Converting _node* to a Code object?

2007-03-31 Thread Brendon Costa
Hi All, I have an application with an embedded python interpreter and i need to get the embedded interpreter to "import" strangely named files as python modules. Anyhow the simple part of the question is: How do i convert a _node* object returned from: PyParser_SimpleParseStringFlagsFilename()

Re: Converting _node* to a Code object?

2007-04-01 Thread Brendon Costa
Gabriel Genellina wrote: > En Sun, 01 Apr 2007 01:35:59 -0300, Brendon Costa <[EMAIL PROTECTED]> > escribió: > >> How do i convert a _node* object returned from: >> PyParser_SimpleParseStringFlagsFilename() >> >> into a code obje

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

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 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-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-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