In this section, we're going to narrow down our focus to the Python standard library's ctypes package, which allows us to interact with dynamic libraries from within Python.
Accessing a dynamic library using ctypes
Locating and linking a dynamic library
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...