is there a problem on this simple code

jrlen balane nbbalane at
Tue Mar 15 10:43:35 CET 2005

did some editing:

rx_data =
byte[0:18] = unpack('19B', rx_data)

   for k in range(9):
       if byte[k] == 70:
           if byte[k+2] == 6:
               if byte[k+9] ==
& 0xff:
                   print byte[k:k+9]
heres the error:
Traceback (most recent call last):
  File "C:\Python23\practices\", line 28, in -toplevel-
    byte[0:18] = unpack('19B', rx_data)
error: unpack str size does not match format

what i am doing here is creating an array from based on the unpacked data
then i am searching for the array member that is equal to "70" since
it is going to be my reference. once i find it, i'll based my received
data from that point. then if the succeding tests are confirmed, i can
get my data.

please help....(again) :(

More information about the Python-list mailing list