T
Size: a a a
T
N
БГ
py3
from ctypes import *
def cut(m):
class t(LittleEndianStructure):
_fields_=[('type', c_uint32,4)]
return t.from_buffer_copy(m[:4]).type
print(cut(b'01'))
Traceback (most recent call last):
File "703583357/source.py", line 6, in <module>
print(cut(b'01'))
File "703583357/source.py", line 5, in cut
return t.from_buffer_copy(m[:4]).type
ValueError: Buffer size too small (2 instead of at least 4 bytes)
БГ
py3
from ctypes import *
def cut(m):
class t(LittleEndianStructure):
_fields_=[('type', c_uint32,4)]
return t.from_buffer_copy(m[:4]).type
print(cut(b'0123'))
0
A
A
A
A
A
A
БГ
A
БГ
A
A
БГ
A
б
