On this page
ctypes.c_byte
Prev: ctypes.c_buffer | Up: ctypes | Next: ctypes.c_char
Rel: ctypes.addressof, ctypes.alignment, ctypes.ArgumentError, ctypes.Array
Ref: docs.python.org — ctypes.c_byte
Tags: #public #python3 #stdlib #ctypes
Import
import ctypes
from ctypes import c_byte
Signature & Overview
ctypes.c_byte(...)
ctypes.c_byte class.
Usage
import ctypes
b = ctypes.c_byte(-5)
assert b.value == -5 and ctypes.sizeof(b) == 1
Gotchas
- Signed 8-bit integer (
-128..127): Values wrap modulo 256 without raisingOverflowError.
REPL Inspect
from ctypes import c_byte
help(c_byte)
Linked from
Related notes
- tuts/python3/stdlib_module/ctypes/c_buffer Linked here; links to this page; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/c_char 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