You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

9 lines
134 B

  1. import struct
  2. import mmap
  3. f = open("test.dat", "rb+")
  4. mm = mmap.mmap(f.fileno(),3)
  5. print len(mm)
  6. print "first 3 bytes: " + mm[0:3];