4 ms·
fyi, you can read mmap files in Python too: import mmap # Unix, Windows with open('c_structs.bin', 'rb') as file, mmap.mmap(file.fileno(), 0, access=mmap.
by d0mine 6y ago
fyi, you can read mmap files in Python too:
import mmap # Unix, Windows
with open('c_structs.bin', 'rb') as file, mmap.mmap(file.fileno(), 0, access=mmap.ACCESS_COPY)) as buf:
result = (YourStruct * 3).from_buffer(buf) # without copying
https://stackoverflow.com/questions/17244488/reading-struct-in-python-from-created-struct-in-c https://stackoverflow.com/questions/17244488/reading-struct-...