> packet_type (1 byte unsigned) || packet_length (1 byte unsigned) || > packet_data(variable) > > How to construct these using python data types, as int and float have > no limits and their sizes are not well defined.
In Python 2.x, use the regular string type: chr(n) will create a single byte, and the + operator will do the concatenation. In Python 3.x, use the bytes type (bytes() instead of chr()). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list