This is what I want to do.

There is some other python module that has some C function pointers in it that I want to use. We'll call it some_module.so.

I built my own Python extension in C (call it my_module.so) that has some lines of code that look like:

Code:
// defined in some_module.so
extern int (*global_button_press)(GtkWidget *widget, GdkEventButton *event);

static PyObject* F (PyObject *self,PyObject *args)
{
    global_button_press = my_button_press;  
}
in some python code I want to do:

import some_module
import my_module

This would mean that w.r.t. my_module, the external function pointer is define at runtime (when some_module is imported)

Is this possible? or something like this possible? How???

Currently I'm just getting some message like 'global_button_press is undefined' when importing my_module.


Thanks!
Jamie.