例子:
import struct
#open binary filefile=open('./xxx.dat','rb')
num = 256 #size of file
a = 20 #start position of file
#show byte by byte
for c in range(a,num):file.seek(c)
data=struct.unpack("B",file.read(1))
print (data[0])
例子:
import struct
#open binary filenum = 256 #size of file
a = 20 #start position of file
#show byte by byte
for c in range(a,num):print (data[0])