(parts)
return msg
Join many parts to one message with a seperator

    A message will look like

    b'foo\xB2\xEA\xC0bar\xB2\xEA\xC0foobar'

    so that it could easily splitted by .split

    parts has to be a tuple of bytestrings
Join many parts to one message with a seperator
Join many parts to one message with a seperator
def build_message(parts):
    """Join many parts to one message with a seperator

    A message will look like

    b'foo\xB2\xEA\xC0bar\xB2\xEA\xC0foobar'

    so that it could easily splitted by .split

    parts has to be a tuple of bytestrings

    """

    msg = b''
    for i in parts[:-1]:
        msg += i
        msg += b'\xB2\xEA\xC0' # \xB2\xEA\xC0 = BREAK
    msg += parts[-1]

    return msg
def build_message ( parts ) : msg = b'' for i in parts [ : - 1 ] : msg += i msg += b'\xB2\xEA\xC0' # \xB2\xEA\xC0 = BREAK msg += parts [ - 1 ] return msg