4

How to read "Unsigned 8/16/24/32/64-bit integer" from binary file ? ( big-endian byte order ) unpack ? any examples ?

2

1 Answer 1

4

Use the struct module. That covers 8,16,32 and 64 bits. 24 bits you will need to do some extra fiddling yourself

Examples are here

Sign up to request clarification or add additional context in comments.

1 Comment

Can you give an example for converting (2) 12-bit data stored in 3 in-order bytes into 2 ints? These are stored in a binary file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.