On this page
ctypes.memoryview_at
Prev: ctypes.memmove | Up: ctypes | Next: ctypes.memset
Rel: ctypes.addressof, ctypes.alignment, ctypes.ArgumentError, ctypes.Array
Ref: docs.python.org — ctypes.memoryview_at
Tags: #public #python3 #stdlib #ctypes
Import
import ctypes
from ctypes import memoryview_at
Signature & Overview
ctypes.memoryview_at(ptr, size, readonly=False)
Return a memoryview representing the memory at void *ptr.
Usage
import ctypes
# Python 3.14+: creates a memoryview directly from a raw address and byte size
assert hasattr(ctypes, "memoryview_at") or True
Gotchas
- Requires Python 3.14+: Unsafe if the address is freed while the
memoryviewis still in use.
REPL Inspect
from ctypes import memoryview_at
help(memoryview_at)
Linked from
Related notes
- tuts/python3/stdlib_module/ctypes/memmove Linked here; links to this page; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/memset Linked here; links to this page; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/ctypes/addressof Linked here; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/alignment Linked here; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/ArgumentError Linked here; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/Array Linked here; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/BigEndianStructure shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/BigEndianUnion shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/byref shared tags: #ctypes, #stdlib