def delete_files(files_list):
    for file_path in files_list:
        if os.path.isdir(file_path):
            shutil.rmtree(file_path)
        else:
            os.remove(file_path)
Delete the files at the file paths in the list. Also works with folders (ufo files).
dataset/ETHPy150Open gferreira/hTools2/Lib/hTools2/modules/fileutils.py/delete_files