def read(cls, byte_object):
a = cls()
ctypes.memmove(ctypes.addressof(a), bytes(byte_object),
min(len(byte_object), ctypes.sizeof(cls)))
return a
# Mixin to allow conversion of a ctypes structure to and from a dictionary.
评论列表
文章目录