John Dann wrote:
I'm new to Python and can't readily find the appropriate function for
the following situation:

I'm reading in a byte stream from a serial port (which I've got
working OK with pyserial) and which contains numeric data in a packed
binary format. Much of the data content occurs as integers encoded as
2 consecutive bytes, ie a 2-byte integer. [...]

Use the unpack() function from the struct module.

-- Gerhard

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to