Sometimes people load a library with ctypes like this:

    libc = ctypes.cdll.LoadLibrary("libc.so")

Don’t do that. Do this instead:

    libc = ctypes.cdll.LoadLibrary("libc.so.6")

What’s the difference? The difference is that the unversioned library comes 
from the “development” package, while the versioned one comes from the 
“runtime” package. Users of your Python binding should only need to have the 
runtime package installed to run scripts that use it, not the development 
package.

So: always load the explicitly-versioned library name.

I thnk this recommendation should be part of the official ctypes docs 
<https://docs.python.org/3/library/ctypes.html>, don’t you?
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to