View Single Post
Posts: 15 | Thanked: 48 times | Joined on Nov 2009 @ United Kingdom
#8
Consider using struct.pack and struct.unpack for this, it handles packing data into C style structs for you, and deals with endian issues transparently.

Possibly overkill in this case, but if you wanted to send more complex data it is very useful indeed.