Is there an equivalent of sys.getsizeof() in micropython?
I am looking to check the size of various objects prior to sending data across a LPWAN from a remote IOT device. If the size is too large I may split the data or save to a local SD card.
If this is not implemented, is there a way I can obtain the size at a point where I ustruct.pack() ??
sorry for the basic python primitives question...
size of object
- philwilkinson40
- Posts: 63
- Joined: Tue Nov 14, 2017 3:11 am
- Location: Perth, Australia
Re: size of object
You can use struct.calcsize(fmt) to determine how much data will be needed to store a given fmt string. This is the same fmt string that is passed to struct.pack