f = open(r"E:/muban.jpg",'rb')
n = 0;
s = f.read(1)
while s:
byte = ord(s)
n = n+1
if n % 16 == 1:
print('%x0 ' % (n//16), end='')
print('%02x,'%(byte),end='')
if n%16==0:
print('')
s = f.read(1)
print('\n\ntotal bytes: %d'%n)
f.close()