Is it possible to skip over bytes when using Python's struct.unpack?

Viewed 1249

It is possible to use Python's struct.unpack to extract the useful values from a Bitmap file header, as follows:

magic, file_size, _, _, data_offset = struct.unpack('<2sLHHL', file_header)
assert magic == 'BM'

Is there any way to avoid the need to assign to _ (or another throwaway variable) here? Is it possible to change the format string to make struct.unpack skip over the two unused H fields?

1 Answers
Related