def __init__(self, directory, target='root'):
        """
        Loops through parent folders in a root directory and moves child files out of sub folders and into parent folder
        :param root: Starting directory
        :param target: Target destination for files.  Default is 'directory' which will move files into corresponding
        directory under parent root.  If set to 'root' then files will be moved into root folder
        """
        self.directory = directory
        self.target = target
        self.root_paths = [Path(self.directory + os.sep + dirs) for dirs in os.listdir(self.directory)]
        self.flatten()
def __init__ ( self , directory , target = 'root' ) : self . directory = directory self . target = target self . root_paths = [ Path ( self . directory + os . sep + dirs ) for dirs in os . listdir ( self . directory ) ] self . flatten ( )
Loops through parent folders in a root directory and moves child files out of sub folders and into parent folder
        :param root: Starting directory
        :param target: Target destination for files.  Default is 'directory' which will move files into corresponding
        directory under parent root.  If set to 'root' then files will be moved into root folder