mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 06:46:17 +00:00
Modified ctypes entry for clarity
This commit is contained in:
+12
-12
@@ -5,18 +5,18 @@ Interfacing with C/C++ Libraries
|
||||
ctypes
|
||||
------
|
||||
|
||||
`ctypes <https://docs.python.org/3/library/ctypes.html>`_ is the de facto
|
||||
library for interfacing with C/C++, and it provides not only full access to
|
||||
the native C interface of most major operating systems (e.g., kernel32 on
|
||||
Windows, or libc on *nix), but also provides support for loading and
|
||||
interfacing with dynamic libraries, such as DLLs or shared objects at runtime.
|
||||
It does bring along with it a whole host of types for interacting with system
|
||||
APIs, and allows you to rather easily define your own complex types, such
|
||||
as structs and unions, and allows you to modify things such as padding and
|
||||
alignment, if needed. It can be a bit crufty to use, but in conjunction with
|
||||
the `struct <https://docs.python.org/3.5/library/struct.html>`_ module, you
|
||||
are essentially provided full control over how your data types get translated
|
||||
into something usable by a pure C(++) method.
|
||||
`ctypes <https://docs.python.org/3/library/ctypes.html>`_ is the CPython
|
||||
included library for interfacing with C/C++, and it provides not only full
|
||||
access to the native C interface of most major operating systems (e.g.,
|
||||
kernel32 on Windows, or libc on *nix), but also provides support for loading
|
||||
and interfacing with dynamic libraries, such as DLLs or shared objects at
|
||||
runtime. It does bring along with it a whole host of types for interacting
|
||||
with system APIs, and allows you to rather easily define your own complex
|
||||
types, such as structs and unions, and allows you to modify things such as
|
||||
padding and alignment, if needed. It can be a bit crufty to use, but in
|
||||
conjunction with the `struct <https://docs.python.org/3.5/library/struct.html>`_
|
||||
module, you are essentially provided full control over how your data types get
|
||||
translated into something something usable by a C(++).
|
||||
|
||||
Struct Equivalents
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user