In Python, how do I read in a binary file and loop over each byte of that file?
Python 3, read all of the file at once:
with open("filename", "rb") as binary_file: # Read the whole file at once data = binary_file.read() print(data)
You can iterate whatever you want using data variable.
data