Binary data exchange

Ian Kelly ian.g.kelly at gmail.com
Thu May 29 19:20:47 EDT 2014


On Thu, May 29, 2014 at 5:09 PM, MRAB <python at mrabarnett.plus.com> wrote:
> On 2014-05-29 23:08, RasikaSrinivasan at gmail.com wrote:
>> the received data for the messages 9 thru 13 are not as expected.
>>
>> I wonder if anyone can see what I am doing wrong?
>>
>> Appreciate any hints. thanks, srini
>>
> I don't understand why you're using the .strip method. That's for
> stripping whitespace from text, but you're not sending and receiving
> text, you're sending and receiving binary data.

And indeed, ASCII characters 9-13 are all whitespace.  The receiver
appears to be stripping off the first byte of the (presumably
little-endian) data and thus shifting the whole struct by a byte for
those entries.



More information about the Python-list mailing list