Numeric type conversions

A.T.Hofkamp hat at
Tue Jun 17 13:47:04 CEST 2008

On 2008-06-17, John Dann <news at> wrote:
> 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.


> Can anyone point me in the right direction towards a suitable function
> please?

The ctypes module should be helpful here


More information about the Python-list mailing list