I have been unable to understand the working of pack in struct in python.
For example I need to make 4 bytes of data together into one struct. Suppose the first byte has the value 4 in it while the second has 5 and then 6 and last 7. so i make it as
a = chr(4 & 0x0f)
b = chr(5 & 0x0f)
c = chr(6 & 0x0f)
d = chr(7 & 0x0f)
Now I need to pack them into a single structure using pack. How should i do it ?
I would also request to please explain in some detail as I need this not for just above example only and i need to understand how to do it.....
Here's the link to it struct