<reponame>eminemence/python3_OOPs<filename>SRC/Chapter_05-When-To-Use-Object-Oriented-Programming/zipexample/inheritance/scalezip.py
from zipprocessor import ZipProcessor
import os
import sys
from pygame import image
from pygame.transform import scale


class ScaleZip(ZipProcessor):
    def process_files(self):
        """Scale each image in the directory to 640x480"""
        for filename in os.listdir(self.temp_dir):
            im = image.load(self._full_filename(filename))
            scaled = scale(im, (640, 480))
            image.save(scaled, self._full_filename(filename))


if __name__ == "__main__":
    ScaleZip(*sys.argv[1:4]).process_zip()

from zipprocessor import ZipProcessor
import os
import sys
from pygame import image
from pygame.transform import scale


class ScaleZip(ZipProcessor):
    def process_files(self):
        """Scale each image in the directory to 640x480"""
        for filename in os.listdir(self.temp_dir):
            im = image.load(self._full_filename(filename))
            scaled = scale(im, (640, 480))
            image.save(scaled, self._full_filename(filename))


if __name__ == "__main__":
    ScaleZip(*sys.argv[1:4]).process_zip()
Scale each image in the directory to 640x480