def save(self, fp, mode='wb'):
        """
        Save the PSD file.

        :param fp: filename or file-like object.
        :param mode: file open mode, default 'wb'.
        """
        if hasattr(fp, 'write'):
            self._record.write(fp)
        else:
            with open(fp, mode) as f:
                self._record.write(f)
def save ( self , fp , mode = 'wb' ) : if hasattr ( fp , 'write' ) : self . _record . write ( fp ) else : with open ( fp , mode ) as f : self . _record . write ( f )
Save the PSD file.

        :param fp: filename or file-like object.
        :param mode: file open mode, default 'wb'.