Download scripts/remove_folder.py from Isaac114514/sfrustum: direct link, hf CLI and curl.
- Browser
- Download file 361 Bytes
-
https://huggingface.co/datasets/Isaac114514/sfrustum/resolve/main/scripts/remove_folder.py
- Command line
-
hf download hf://datasets/Isaac114514/sfrustum/scripts/remove_folder.py
-
curl -L -o remove_folder.py https://huggingface.co/datasets/Isaac114514/sfrustum/resolve/main/scripts/remove_folder.py
361 Bytes
| import os | |
| import shutil | |
| # 设置文件夹路径和长度限制 | |
| dir_path = 'scannet' | |
| max_length = 12 | |
| # 遍历文件夹 | |
| for foldername in os.listdir(dir_path): | |
| # 检查文件夹长度是否超过限制 | |
| if len(foldername) > max_length: | |
| # 如果超过,则删除该文件夹及其内容 | |
| shutil.rmtree(os.path.join(dir_path, foldername)) | |