I am new to binary files and trying to figure out how to read and manipulate them. I have the following code:
bfile = open('square.bmp', 'wb')
b = bytearray(bfile.read(bn))
while len(b) > 0:
b = bytearray(bfile.read(bn))
print(b)
bfile.close()
However, running this code is throwing errors and I do not know what I can replace the "bn" with or declare it as to run read the entire file.