June 2017
Beginner to intermediate
274 pages
6h 49m
English
Probably, the most common need to interact with compiled code is when there's a library out there that does exactly what we need but it's not a Python library. Perhaps it was instead written for C, or it has a C interface.
We're not going to let a little thing like this stop us. Instead, we'll use ctypes to create an interface module for the library. For basic usage, ctypes is very simple. We just need to import it, load the dynamic library by the filename, and call a function in that library as shown in the following code example:

The CDLL constructor we called in this example creates a Python object ...