I have a data file which has written data (which forms a data of C++ structure from an application). Now I am using python to read this data file. What is the best way to provide this structure as a input template and then have a logic to read based on this template.
Idea is that if the structure (in my C++ application changes) then for script to maintain compatibility, I would like to change the template and no other change should suffice me with the data read.
I’d declare ctypes.Struct classes in Python as templates, and then use the regular ctypes functions to marshal and unmarshal from byte arrays to structs.