获取PyCSimpleType的值?

2024-09-28 22:10:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我有

 class Temp(ctypes.Structure):
_fields_ = [('a', ctypes.c_longlong), 
            ('b', ctypes.c_uint32)]   

我希望得到b的值(在python中它应该是int/long)。在

我尝试使用

^{pr2}$

但我知道

<attribute 'value' of '_ctypes._SimpleCData' objects>

坦白地说,我不知道如何以整数/长格式访问此值。 这个结构是由C++程序填充的,我如何访问它?在


Tags: offieldsobjectsvalueattributectypesstructuretemp