Re: embedding and extending python C API registering callback handler objects

2008-06-27 Thread Tim Spens
--- On Fri, 6/27/08, Tim Spens <[EMAIL PROTECTED]> wrote: > From: Tim Spens <[EMAIL PROTECTED]> > Subject: Re: embedding and extending python C API registering callback > handler objects > To: python-list@python.org, "Matimus" <[EMAIL PROTECTED]>

Re: embedding and extending python C API registering callback handler objects

2008-06-27 Thread Tim Spens
day, June 27, 2008, 9:03 AM > On Jun 27, 8:22 am, Tim Spens <[EMAIL PROTECTED]> > wrote: > > Hello all, > > > > I've been trying to get an example found > herehttp://codeidol.com/python/python3/Embedding-Python/Registering-Callb... > > to work. Every thin

embedding and extending python C API registering callback handler objects

2008-06-27 Thread Tim Spens
Hello all, I've been trying to get an example found here http://codeidol.com/python/python3/Embedding-Python/Registering-Callback-Handler-Objects/ to work. Every thing works fine except when I try to trigger an event from c that will call a python function. Here is my test code: //-

simplest c python api callback example

2008-06-26 Thread Tim Spens
The following is a simple complete example using the c python api to generate callbacks from c to python. But when I run the c code I get a segfault in PyInt_FromLong () (see below). Most of this example code was taken from pg 1478 of the 3rd edition python o'reilly book. I cannot see what I'

Re: Beginner Pyserial Question

2008-01-24 Thread Tim Spens
COM = 0 #for COM1 BAUD = 115200 class serial_port(): def __init__(self): self.start_time = None self.end_time = None self.asleep_duration = None self.device = serial.Serial() self.device.timeout = 1 self.device.baudrate = BAUD self.devic

handling asynchronous callbacks from c++ in a python script

2008-01-23 Thread Tim Spens
I have a c++ program running that has boost python hooks for the c++ api. I'm running a python client that makes calls into the c++ api. The problem is there are c++ asynchronous callbacks that need to pass information to the python client. What I was hoping to do is call a python function from