I have a list of hex strings representing bytes, of the form “FF”. I want to convert the whole list to a byte stream so I can send it over a socket (Python 3). It looks like the bytearray type would work, but I can’t find any way to directly convert the list to a bytearray.
I can do it manually in a loop, but figure there must be a better Python way to do this.
If you’ve got a lot of ’em, it might be worthwhile to see which of those is fastest.