jrlen balane <[EMAIL PROTECTED]> wrote: >why is it that here: > >1)rx_data = ser.read(10) > (rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1, >pyra2, voltage, current, rx_checksum) = unpack('10B', rx_data) > print rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1, >pyra2, voltage, current, rx_checksum > >>>> type (rx_command) ><type 'int'> > >but here: > >2)rx_data_command = ser.read() > (rx_command) = unpack('1B', rx_data_command) > >>>> type (rx_command) ><type 'tuple'> > >how can i make rx_command of type 'int' if i am to use 2)?
Did you get an answer to this? I couldn't see any responses. The answer is either: rx_command = unpack('1B', rx_data_command)[0] or (rx_command,) = unpack('1B', rx_data_command) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list