I need to build a tcp frame with raw binary data, but all examples and tutorials I\'ve found talking about bytes always involve conversion from a string, and that\'s not wha
agf's bytearray solution is workable, but if you find yourself needing to build up more complicated packets using datatypes other than bytes, you can try struct.pack(). http://docs.python.org/release/3.1.3/library/struct.html