Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
2e9675ad
Kaydet (Commit)
2e9675ad
authored
Haz 11, 2008
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More doc fixes.
üst
13f7382e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
15 deletions
+6
-15
ctypes.rst
Doc/library/ctypes.rst
+6
-15
No files found.
Doc/library/ctypes.rst
Dosyayı görüntüle @
2e9675ad
...
...
@@ -721,6 +721,8 @@ would cause the pointer to point to the memory location where this is stored::
c_long(99)
>>>
.. XXX Document dereferencing pointers, and that it is preferred over the .contents attribute.
Pointer instances can also be indexed with integers::
>>> pi[0]
...
...
@@ -767,7 +769,7 @@ Calling the pointer type without an argument creates a ``NULL`` pointer.
>>>
``ctypes`` checks for ``NULL`` when dereferencing pointers (but dereferencing
non-\ ``NULL`` pointers would crash Python)::
invalid
non-\ ``NULL`` pointers would crash Python)::
>>> null_ptr[0]
Traceback (most recent call last):
...
...
@@ -813,9 +815,9 @@ To set a POINTER type field to ``NULL``, you can assign ``None``::
>>> bar.values = None
>>>
XXX list other conversions...
..
XXX list other conversions...
Sometimes you have instances of incompatible types. In
``C``
, you can cast one
Sometimes you have instances of incompatible types. In
C
, you can cast one
type into another type. ``ctypes`` provides a ``cast`` function which can be
used in the same way. The ``Bar`` structure defined above accepts
``POINTER(c_int)`` pointers or :class:`c_int` arrays for its ``values`` field,
...
...
@@ -1072,7 +1074,7 @@ crashing your program when a callback is made.
Accessing values exported from dlls
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some
times, a dll not only exports functions, it also exports
variables. An
Some
shared libraries not only export functions, they also export
variables. An
example in the Python library itself is the ``Py_OptimizeFlag``, an integer set
to 0, 1, or 2, depending on the :option:`-O` or :option:`-OO` flag given on
startup.
...
...
@@ -1248,17 +1250,6 @@ dynamic nature of Python, and (re-)define the data type after the required size
is already known, on a case by case basis.
.. _ctypes-bugs-todo-non-implemented-things:
Bugs, ToDo and non-implemented things
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Enumeration types are not implemented. You can do it easily yourself, using
:class:`c_int` as the base class.
``long double`` is not implemented.
.. _ctypes-ctypes-reference:
ctypes reference
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment