I'm working on a Python Application that reads from a binary file, pulls a byte that then references a list. This is essentially what I'm doing.
list = [x for x in range(0, 340)]
index = struct.unpack('<b', file.read(1))
print(list[index])
The problem is that the file I'm reading from, the 8th bit denotes a positive value, rather than making the number negative. For example, I hope to read b'11111111' to read as 255 and not as the negative number that it's producing. I'm not familiar with the struct module, and not sure if I'm doing something wrong with using the module, or if it's a feature of Python that I'm not sure how to create a workaround for.