16.16. ctypes — A foreign function library for Python — Python 3.4.2 documentation

index modules | next | previous | Python » 3.4.2 Documentation » The Python Standard Library » 16. Generic Operating System Services » ctypes ¶ 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. ¶ 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 c_int type. This type is an alias for the c_long type on 32-bit systems. So, you should not be confused if c_long is printed if you would expect c_int — they are actually the same type. ¶ ctypes exports the cdll , and on Windows windll and oledll objects, for loadin...

Linked on 2014-12-21 21:08:49 | Similar Links