Just watching your videos on twitch. I notice that in your bitstream loading code you have
sleep(0.2). The python sleep parameter is in seconds, so your waits are in milliseconds not microseconds.
You also say there is no
+= in python, but there is. It is
++ that is doesn't have.
Also your write_bytes function doesn't look as if it writes out the last chunk of data if it is less than 64 bytes.