Numeric type conversions

A.T.Hofkamp hat at se-162.se.wtb.tue.nl
Tue Jun 17 07:47:04 EDT 2008


On 2008-06-17, John Dann <news at prodata.co.uk> 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.

[snipperdesnip]

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

The ctypes module should be helpful here

Sincerely,
Albert



More information about the Python-list mailing list