Howto Extract PNG from binary file @ 0x80?

Robert Kern rkern at
Mon Jan 3 21:02:27 EST 2005

Don't seek to position 97. Seek to 96. You're off by one. That's why 
there's the test for the header (which you removed).

Files (and Python strings for that matter) are 0-indexed. The first 
character is 0, the second 1, and so on. If you want the 97th character, 
you have to seek to position 96.

Robert Kern
rkern at

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

More information about the Python-list mailing list