Generic Operating System Services¶
The modules described in this chapter provide interfaces to operating system features that are available on (almost) all operating systems, such as files and a clock. The interfaces are generally modeled after the Unix or C interfaces, but they are available on most other systems as well. Hereâs an overview:
osâ Miscellaneous operating system interfacesioâ Core tools for working with streamstimeâ Time access and conversionsloggingâ Logging facility for Pythonlogging.configâ Logging configurationlogging.handlersâ Logging handlersplatformâ Access to underlying platformâs identifying dataerrnoâ Standard errno system symbolsctypesâ 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
- ctypes tutorial