ctypes.create_unicode_buffer
Prev: ctypes.create_string_buffer | Up: ctypes | Next: ctypes.get_errno
Rel: ctypes.addressof, ctypes.alignment, ctypes.ArgumentError, ctypes.Array
Ref: docs.python.org — ctypes.create_unicode_buffer
Tags: #public #python3 #stdlib #ctypes
Import
import ctypes
from ctypes import create_unicode_buffer
Signature & Overview
ctypes.create_unicode_buffer(init, size=None)
create_unicode_buffer(anInteger) -> character array create_unicode_buffer(aString, anInteger) -> character array
Usage
import ctypes
buf = ctypes.create_unicode_buffer("hello", 10)
assert len(buf) == 10 and buf.value == "hello"
Gotchas
- Mutable
c_wchararray: Useful for Windows wide-character (W) Win32 APIs.
REPL Inspect
from ctypes import create_unicode_buffer
help(create_unicode_buffer)
Linked from
Related notes
- tuts/python3/stdlib_module/ctypes/create_string_buffer Linked here; links to this page; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/get_errno 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