Напишите бинарный файл в Python

file = open("sample.bin", "wb")
COPYfile.write(b"This binary string will be written to sample.bin")
COPYfile.close()
smjure