[python] Python how to write to a binary file?