Skip to content
UPEEC

ctypes, cffi and Calling C Libraries

Call functions in shared libraries (.dll/.so) directly from Python.

Advanced
Comments 0
import ctypes
libc = ctypes.CDLL(None)          # Linux
libc.printf(b"hello from C\n")

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.