how to get a reference to python caller of a C api function -
how to get a reference to python caller of a C api function -
i implementing embedded python interpreter next https://docs.python.org/3/extending/embedding.html
there way me create own apis c programme user can phone call own internal c functions python script.
this works fine, able know script function got called. every function must have these parameters according manual:
static pyobject *someapifunction(pyobject *self, pyobject *args)
but manual doesn't explain self
assumed self reference module called function, wrong. tried phone call pymodule_getname
on self , returned internal name of application set during initialization (using pymodule_create
).
is there way recognize module called c function?
if doing in python, utilize next line:
module_path = sys._getframe(1).f_code.co_filename
you might able similar in c api, have never worked it.
python c
Comments
Post a Comment