import os
import traceback


class InputHandler:

    IMAGES_PARENT_FOLDER = './images'

    def __init__(self):
        filesList = []

    def listFiles(self,path=''):
        if path != '':
            self.IMAGES_PARENT_FOLDER = path
        
        try:
            self.listFiles = [os.path.join(self.IMAGES_PARENT_FOLDER,imageFile) for imageFile in os.listdir(self.IMAGES_PARENT_FOLDER)\
                            if os.path.isfile(os.path.join(self.IMAGES_PARENT_FOLDER,imageFile))]
        except:
            print(traceback.print_exec())
        
        return self.listFiles

if __name__ == '__main__':
    obj = InputHandler()
    print(obj.listFiles())
[((17, 30, 17, 79), 'os.path.join', 'os.path.join', ({(17, 43, 17, 68): 'self.IMAGES_PARENT_FOLDER', (17, 69, 17, 78): 'imageFile'}, {}), '(self.IMAGES_PARENT_FOLDER, imageFile)', False, 'import os\n'), ((17, 97, 17, 134), 'os.listdir', 'os.listdir', ({(17, 108, 17, 133): 'self.IMAGES_PARENT_FOLDER'}, {}), '(self.IMAGES_PARENT_FOLDER)', False, 'import os\n'), ((20, 18, 20, 40), 'traceback.print_exec', 'traceback.print_exec', ({}, {}), '()', False, 'import traceback\n'), ((18, 46, 18, 95), 'os.path.join', 'os.path.join', ({(18, 59, 18, 84): 'self.IMAGES_PARENT_FOLDER', (18, 85, 18, 94): 'imageFile'}, {}), '(self.IMAGES_PARENT_FOLDER, imageFile)', False, 'import os\n')]