Embeding Python & Dynamic Callbacks

David Bolen db3l at fitlinxx.com
Wed Sep 26 16:52:38 EDT 2001


paulypoos at hotmail.com (Paul Tate) writes:

> I can dynamically create the method table, but I cannot dynamically
> create a C callback function.  If I use the same callback for each
> dynamically loaded function, I do not know how to find out which token
> caused the callback to be called.

In addition to some of the other suggestions, you might try pushing
out some of your work into Python itself.  That is, your "embedding"
of Python would be both by bringing the interpreter into your
application, but also by providing a module used by scripts.  You
could then publish your entry points (not through the method table,
but just by providing a list or dictionary object) which the Python
module could use to dynamically construct whatever support your
embedded scripts needed.

This would minimize the amount of work you have to do in C, and get
you all the flexibility of Python in glueing embedded scripts to your
application.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list