Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将python int转换为int16\t类型_Python_C_Python 2.7_Types_Type Conversion - Fatal编程技术网

将python int转换为int16\t类型

将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可以使用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
呢?如果需要,还支持
ctypes.c_uint16

文档:


int16\u t
uint16\u t
?阅读文档,IIRC,有一个尺寸对应表。是的,有,但它没有提到任何类型,甚至没有提到整数大小类型。
int16\u t
uint16\u t
?阅读文档,IIRC,有一个尺寸对应表。是的,有,但它没有提到任何类型的_t,甚至整数大小类型。