On this page
ctypes.memmove
Prev: ctypes.get_errno | Up: ctypes | Next: ctypes.memoryview_at
Rel: ctypes.addressof, ctypes.alignment, ctypes.ArgumentError, ctypes.Array
Ref: docs.python.org — ctypes.memmove
Tags: #public #python3 #stdlib #ctypes
Import
import ctypes
from ctypes import memmove
Signature & Overview
ctypes.memmove(*args, **kwargs)
ctypes.memmove() function.
Usage
import ctypes
src = ctypes.create_string_buffer(b"hello")
dst = ctypes.create_string_buffer(6)
ctypes.memmove(dst, src, 6)
assert dst.value == b"hello"
Gotchas
- Safe on overlapping memory regions: Always double-check byte counts—overrunning
dstcorrupts process memory.
REPL Inspect
from ctypes import memmove
help(memmove)
Linked from
Related notes
- tuts/python3/stdlib_module/ctypes/get_errno Linked here; links to this page; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/memoryview_at 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