clear.py 837 B

1234567891011121314151617181920212223
  1. import os
  2. import shutil
  3. # Path to the parent directory containing the test folders
  4. parent_directory = './tests'
  5. # Iterate over each folder inside the parent directory
  6. for folder_name in os.listdir(parent_directory):
  7. folder_path = os.path.join(parent_directory, folder_name)
  8. # Check if the path is a directory and not a file
  9. if os.path.isdir(folder_path):
  10. # Delete PyDEVS folder if it exists
  11. pydevs_path = os.path.join(folder_path, 'ClassicDEVS')
  12. if os.path.exists(pydevs_path):
  13. shutil.rmtree(pydevs_path)
  14. print(f"Deleted {pydevs_path}")
  15. # Delete Python folder if it exists
  16. python_path = os.path.join(folder_path, 'Python')
  17. if os.path.exists(python_path):
  18. shutil.rmtree(python_path)
  19. print(f"Deleted {python_path}")