On Jan 25, 12:52 am, "Martin v. Löwis" <mar...@v.loewis.de> wrote: > > 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()).
This looks really helpful thanks! -- http://mail.python.org/mailman/listinfo/python-list