On this page
  1. ctypes.string_at
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

ctypes.string_at

Prev: ctypes.sizeof | Up: ctypes | Next: ctypes.wstring_at
Rel: ctypes.addressof, ctypes.alignment, ctypes.ArgumentError, ctypes.Array
Ref: docs.python.org — ctypes.string_at
Tags: #public #python3 #stdlib #ctypes


Import

import ctypes
from ctypes import string_at

Signature & Overview

ctypes.string_at(ptr, size=-1)

Return the byte string at void *ptr.

Usage

import ctypes

buf = ctypes.create_string_buffer(b"hello\x00world", 12)
assert ctypes.string_at(buf) == b"hello"
assert ctypes.string_at(buf, 11) == b"hello\x00world"

Gotchas

REPL Inspect

from ctypes import string_at
help(string_at)

Linked from

Related notes