I am working with binary data. I have a file containing 2KB of binary data. I have used the following code to read the file and then print it. I have also tried to view the file contents using hexdump in the terminal. I am getting different outputs 1 and 2 (shown in attached screenshots) of the same file in python and hexdump. I am assuming it might be due to the encoding scheme used by python? I am very naive about working with binary data. Can anyone kindly check it and let me know the reasons for this? I also want to know if that's the correct way of reading a large binary file?
print("First File \n");
f1 = open("/data/SRAMDUMP/dataFiles/first.bin","rb")
num1 = list(f1.read())
print(num1)
f1.close()

