So i am trying to get a file of just the binary in ex23. i have added a few lines just to have a file called raw.txt and write the binary to it. it is defined as raw = open("raw.txt:, “wb”)
if i print the line raw_bytes it works. but if i try the following i never get the raw bytes in the file:
raw.write(raw_bytes)
the file only writes the encoded format. Can you please help me understand why?
Actually, just skip that part of the exercise. It doesn’t really make sense. My original intention was that you’d write out the converted bytes as a Python string with the \x00 kind of syntax but then after it was published that kind of got clobbered and the resulting exercise doesn’t make sense. The file already is in binary, so there’s no conversion going on.