P
Paul D Ainsworth
Greetings everyone. I'm a relative newcomer to python and I have a technical
problem.
I want to split a 32 bit / 4 byte unsigned integer into 4 separate byte
variables according to the following logic: -
bit numbers 0..7 byte 1
bit numbers 8..15 byte 2
bit numbers 16..23 byte 3
bit numbers 24..31 byte 4
Each of these byte variables to contain integer data from 0 to 255 (or 0 to
FF in hex mode)
I had thought that struct.unpack with an input message format of 'I' would
be the way to do it, but its reporting an error that it doesn't want to
accept an integer.
Please can anyone advise?
problem.
I want to split a 32 bit / 4 byte unsigned integer into 4 separate byte
variables according to the following logic: -
bit numbers 0..7 byte 1
bit numbers 8..15 byte 2
bit numbers 16..23 byte 3
bit numbers 24..31 byte 4
Each of these byte variables to contain integer data from 0 to 255 (or 0 to
FF in hex mode)
I had thought that struct.unpack with an input message format of 'I' would
be the way to do it, but its reporting an error that it doesn't want to
accept an integer.
Please can anyone advise?