ctypes
ctypes — A foreign function library for Python
ctypes
is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap these libraries in pure Python.
1. ctypes tutorial
Note: The code samples in this tutorial use doctest
to make sure that they actually work. Since some code samples behave differently under Linux, Windows, or Mac OS X, they contain doctest directives in comments.
Note: Some code samples reference the ctypes 登录查看完整内容