将python int转换为int16\t类型
我知道python int可以使用ctypes转换为c int类型。将python int转换为int16\t类型,python,c,python-2.7,types,type-conversion,Python,C,Python 2.7,Types,Type Conversion,我知道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. 如何ctypes.c_int16?如果需要,还支持ctypes.c_uint16 文档: 和 那么ctypes.c_int16呢?如果需要
但如何将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.
如何
ctypes.c_int16
?如果需要,还支持ctypes.c_uint16
文档:和
那么
ctypes.c_int16
呢?如果需要,还支持ctypes.c_uint16
文档:和
int16\u t
或uint16\u t
?阅读文档,IIRC,有一个尺寸对应表。是的,有,但它没有提到任何类型,甚至没有提到整数大小类型。int16\u t
或uint16\u t
?阅读文档,IIRC,有一个尺寸对应表。是的,有,但它没有提到任何类型的_t,甚至整数大小类型。