I'm trying to write 32 bytes of binary data to a file but an extra byte is being added
wb
mode doesn't seem to accept a newline argument so I'm not sure what to do here.
str_ = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
with open('test.bin', 'wb') as f:
f.write(str_)
You MUST view the file in a hex editor to be able to see the extra byte being added. Hex View of the file from VIM: https://i.stack.imgur.com/y8EpD.png