What is this data structure? (b'zzzz', ('192.168.4.16', 43578)) #9629
Unanswered
boylesg
asked this question in
Using MicroPython
Replies: 1 comment 16 replies
-
It's a bytes string (i.e. a string of bytes). https://docs.python.org/3/library/stdtypes.html#bytes This is different to a regular string which is a string of characters (which may not actually be bytes, e.g. utf-8 encoded). You can use ValuePair.decode() to decode bytes into a string. |
Beta Was this translation helpful? Give feedback.
16 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Obtained via this code
ValuePair = self.Socket.recvfrom(self.nReceiveDataSize)
print(ValuePair)
What is the 'b' about?
'zzzz' is the data I sent from my mobile phone over Wifi access point.
It looks to me like an array of 2 elements where the first element is the string 'zzzz' and the second element is another array.
Beta Was this translation helpful? Give feedback.
All reactions