Spaces:
Sleeping
Sleeping
| import os | |
| import shutil | |
| # Set the root directory, e.g., current directory | |
| root_dir = "." | |
| for dirpath, dirnames, filenames in os.walk(root_dir): | |
| if "__pycache__" in dirnames: | |
| cache_path = os.path.join(dirpath, "__pycache__") | |
| shutil.rmtree(cache_path) | |
| print(f"Deleted: {cache_path}") | |