python - Cython: Dynamically linking with a dll/so -


i'm working api distributed dll/so file need dynamically link python program. accomplish this, want use cython.

i have been able to, in past, link dll statically. works well, except api comes in 4 different flavors, theoretically infinitely more come , users should able compile them whatever name want (kinda plugin system). because of that, can't make so/pxd file statically links 1 library, or links selection of them.

what need able pass so/dll name cython code , have "import" it. know can done ctypes via ctypes.cdll.loadlibrary, kind of thing possible in cython? going have use ctypes this?

i assume talking writing c modules here. if yes can. don't know equivalent on windows is, in linux can use dlopen , friends. there man page it, , several web sites documenting it. try link "http://linux.die.net/man/3/dlopen" provides nice example near bottom of page. doing same thing ctypes does, in fact think might ctypes uses.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -