def seek(self, frame): if frame >= len(self._offset): raise EOFError("attempt to seek outside DCX directory") self.frame = frame self.fp = self.__fp self.fp.seek(self._offset[frame]) PcxImageFile._open(self)