cint - ctypes Integer Aliases

1.0.0 · abandoned · verified Sun Apr 12

cint provides Python 2.7 aliases for `ctypes` integer types, aiming to simplify their use. It wraps C integer types (e.g., `int8`, `uint32`) directly from the `ctypes` module. The library is currently at version 1.0.0, with no active development since 2017, indicating an abandoned status.

Warnings

Install

Imports

Quickstart

Demonstrates the creation and inspection of C integer types using `cint`'s aliases. Note that `cint` effectively provides direct aliases to `ctypes` types.

# This example is intended for Python 2.7.
# The `cint` library provides convenient aliases for ctypes integer types.
# For Python 3, it's recommended to use `ctypes` directly.
from cint import int32, uint16

# Create a signed 32-bit integer using cint's alias
my_signed_int = int32(-100)
print "Value:", my_signed_int.value
print "Python type of value:", type(my_signed_int.value)
print "Actual ctypes type:", type(my_signed_int) # This will show the actual ctypes type

# Create an unsigned 16-bit integer
my_unsigned_int = uint16(65530)
print "Value:", my_unsigned_int.value
print "Python type of value:", type(my_unsigned_int.value)
print "Actual ctypes type:", type(my_unsigned_int)

view raw JSON →