As noted here receiving a message through a Micropython socket results in being left with a byte string to work with. My question is how to convert this byte string to another usable format?
I have tried the likes of:
data = s.recv(64)
new = hex(data)
which results in errors such as:
TypeError: can t convert bytes to int
And: data = s.recv(64).hex() Resulting in:
AttributeError: bytes object has no attribute hex
I am fairly new to Python and Micro-python in general. As far as I can tell this has not been answered directly for Micropython.
If this has been answered specifically for Python3 I think it worthwhile to re-iterate it for Micropython since implementation can be slightly different and to perhaps find an acceptable best practice .