Hi there... I don't know if the question title is correctly set. I'm trying to read a BMP file in python. I know the first two bytes indicate the bmp firm. Next 4 bytes are the file size. When I excecute:
fin = open("hi.bmp", "rb") firm = fin.read(2) file_size = int(fin.read(4))
I get
ValueError: invalid literal for int() with base 10: 'F#\x13'
What I want to do is reading those 4 bytes as an integer... It seems python is reading them as characters and returning a string, which cannot be converted to an integer. How can I do this correctly?
Thanks!