admin管理员组文章数量:1566988
这不起作用:
class ifinfomsg(ctypes.Structure):
_fields_ = [
('ifi_family', ctypes.c_ubyte),
('__ifi_pad', ctypes.c_ubyte),
('ifi_type', ctypes.c_ushort),
('ifi_index', ctypes.c_int),
('ifi_flags', ctypes.c_uint),
('ifi_change', ctypes.c_uint(0xFFFFFFFF))
]
它错误:
File "rtnetlink.py", line 243, in
class ifinfomsg(ctypes.Structure):
TypeError: Error when calling the metaclass bases
second item in _fields_ tuple (index 5) must be a C type
但是我可以在__init __()中设置值:
class ifinfomsg(ctypes.Structure):
_fields_ = [
('ifi_family', ctypes.c_ubyte),
('__ifi_pad', ctypes.c_ubyte),
('ifi_type', ctypes.c_ushort),
('ifi_index', ctypes.c_int),
('ifi_flags',
本文标签: 默认值ctypesPythonStructurestructurepython
版权声明:本文标题:python ctypes structure_python – 设置ctypes.Structure默认值 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1725839522a1044863.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论