Theme
Auto
Light
Dark
Table of Contents
ctypes
— A foreign function library for Python
ctypes tutorial
Loading dynamic link libraries
Accessing functions from loaded dlls
Calling functions
Fundamental data types
Calling functions, continued
Calling variadic functions
Calling functions with your own custom data types
Specifying the required argument types (function prototypes)
Return types
Passing pointers (or: passing parameters by reference)
Structures and unions
Structure/union layout, alignment and byte order
Bit fields in structures and unions
Arrays
Pointers
Thread safety without the GIL
Type conversions
Incomplete Types
Callback functions
Accessing values exported from dlls
Surprises
Variable-sized data types
ctypes reference
Finding shared libraries
Listing loaded shared libraries
Loading shared libraries
Foreign functions
Function prototypes
Utility functions
Data types
Fundamental data types
Structured data types
Arrays and pointers
Exceptions
Previous topic
errno
— Standard errno system symbols
Next topic
Command-line interface libraries