I have a string of data like FF0000FF and I want to write that to a file as raw 8-bit bytes 11111111 00000000 00000000 11111111. However, I seem to end up getting way to much data FF turns into FF 00 00 00 when using struct.pack or I get a literal ASCII version of the 0's and 1's.
How can I simply take a string of hex and write that as binary, so when viewed in a hex-editor, you see the same hex string?