This is for file compression. I would like to save a binary string, for example "00011110" as that actual sequence of 1s and 0s, so that when I use Powershell's "format-hex" command to view the saved file, I will see
1E
which is the hex representation of the binary number 00011110. Rather than
00 00 00 01 01 01 01 00
which is what bytearray() would give me. It seems like there should be a simple way to do this.