Advertisement
wellidkk

remove copy

Apr 4th, 2023
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. b'from itertools import combinations\nimport os, re\n\ndef list_full_paths(directory):\n    return [os.path.join(directory, file) for file in os.listdir(directory)]\n\nexcluded_files = [\n"/Users/lousergonne/Documents/GitHub/calendar/database/new_struct/sql_structure/php_insert/t.py",\n"/Users/lousergonne/Documents/GitHub/calendar/database/new_struct/sql_structure/php_insert/student_entreprise"\n]\n\n# dirs = os.listdir("/Users/lousergonne/Documents/GitHub/calendar/database/queries/sql_new_structure")\ndirs = list_full_paths("/Users/lousergonne/Documents/GitHub/calendar/database/new_struct/sql_structure/php_insert/")\n\ndef remove_items(source_list, items_to_remove):\n    for item in items_to_remove:\n        while item in source_list:\n            source_list.remove(item)\n\nremove_items(dirs, excluded_files)\n\nfor dir in dirs:\n    if "_" in dir:\n        os.remove(dir)'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement