While writing a python wrapper for the getmntent linux libc function, there is a strange difference between the behaviour between python 2.x and 3.x for the following code where most of the real work is done by the C library. Since I interface C code with python often, Can anyone explain or correct what is go…
Tag: ctypes
Why does loading the libc shared library have “‘LibraryLoader’ object is not callable” error?
From https://en.wikipedia.org/wiki/Foreign_function_interface the ctypes module can load C functions from shared libraries/DLLs on-the-fly and translate simple data types automatically between Python and C semantics as follows: On Lubuntu 18.04 I was wondering why loading the libc shared library has “&#…
python ctypes C++ get back char* missing last character on linux
i have the following C++ code: which is using ifreq to get the mac address of the local PC and sticks it into a array of chars. The routine gets compiled in the “Utility.so” Then i have the following python code: and i get the following result 02:00:AC:99:00:9 when my MAC is actually: 02:00:AC:99:…