Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8609

MicroPython • Re: Why is struct.unpack_from giving me a bad typecode?

$
0
0
Thanks both.

Since all the data I am unpacking is in network byte order, "!HHHHHH" works fine.

In my defence, the documentation on the site doesn't make clear what the format restrictions are, as it just says it is a subset of the CPython module, assuming (in my case incorrectly!) that one would be familiar with the CPython version.

As is (or should be) obvious from my posts in here, I am relatively inexperienced with Python, having been a C/C++ developer for more years than I would comfortably admit, much of that being spent finding and occasionally fixing bugs in other peoples' code - including on one glorious occasion, a bug in the early (circa 1995) MFC CArchive code.

So I have learned two things - firstly, a solution to my current issue, thanks again, and secondly, to read the corresponding documentation for the CPython libraries when making sense of the micropython version.. Every day is a school day.

Statistics: Posted by SteveSpencer — Mon Sep 08, 2025 8:04 am



Viewing all articles
Browse latest Browse all 8609

Trending Articles