【发布时间】:2016-06-07 12:17:26
【问题描述】:
我知道 python int 可以使用 ctypes 转换成 c int 类型。
但是如何将 python int 转换成 int16_t 类型呢?
我试过了:
import ctypes as ct
my_c_number = ct.c_int16_t(1)
#Apparently ctypes library does not have c_int16_t attribute.
【问题讨论】:
-
int16_t或uint16_t?并阅读文档,IIRC,有一个尺寸对应表。 -
要么。是的,但它没有提到任何 _t 类型甚至 int 大小类型。
标签: python c python-2.7 types type-conversion