johnty wrote:
i'm reading bytes from a serial port, and storing it into an array.
Try reading into a type "bytearray". That's the proper data type
for raw bytes.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 2, 6:25 am, John Machin wrote:
> On Jun 2, 4:43 pm, johnty wrote:
>
> > i'm reading bytes from a serial port, and storing it into an array.
>
> > each byte represents a signed 8-bit int.
>
> > currently, the code i'm looking at converts them to an unsigned int by
> > doing ord(array[i]). h
On Jun 2, 4:43 pm, johnty wrote:
> i'm reading bytes from a serial port, and storing it into an array.
>
> each byte represents a signed 8-bit int.
>
> currently, the code i'm looking at converts them to an unsigned int by
> doing ord(array[i]). however, what i'd like is to get the _signed_
> inte
On Jun 2, 12:04 am, Christian Heimes wrote:
> > i'm reading bytes from a serial port, and storing it into an array.
>
> > each byte represents a signed 8-bit int.
>
> > currently, the code i'm looking at converts them to an unsigned int by
> > doing ord(array[i]). however, what i'd like is to get
> i'm reading bytes from a serial port, and storing it into an array.
>
> each byte represents a signed 8-bit int.
>
> currently, the code i'm looking at converts them to an unsigned int by
> doing ord(array[i]). however, what i'd like is to get the _signed_
> integer value. whats the easiest way
On Tue, 01 Jun 2010 23:43:33 -0700, johnty wrote:
> i'm reading bytes from a serial port, and storing it into an array.
An array or a list?
> each byte represents a signed 8-bit int.
>
> currently, the code i'm looking at converts them to an unsigned int by
> doing ord(array[i]). however, what
johnty, 02.06.2010 08:43:
i'm reading bytes from a serial port, and storing it into an array.
each byte represents a signed 8-bit int.
currently, the code i'm looking at converts them to an unsigned int by
doing ord(array[i]). however, what i'd like is to get the _signed_
integer value. whats t
i'm reading bytes from a serial port, and storing it into an array.
each byte represents a signed 8-bit int.
currently, the code i'm looking at converts them to an unsigned int by
doing ord(array[i]). however, what i'd like is to get the _signed_
integer value. whats the easiest way to do this?