Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In Python a str can be iterated and indexed in the same way as a list: msg.buf[i]

Each 8-bit character can be converted into a number using ord().

To get the same result as you see on the console you can do a list comprehension: [ord(c) for c in msg.buf]