Download OBJECTS-MAPPED/scripts/log_files.py from pebxcvi/PSHomeCacheDepot: direct link, hf CLI and curl.
- Browser
- Download file 813 Bytes
-
https://huggingface.co/datasets/pebxcvi/PSHomeCacheDepot/resolve/main/OBJECTS-MAPPED/scripts/log_files.py
- Command line
-
hf download hf://datasets/pebxcvi/PSHomeCacheDepot/OBJECTS-MAPPED/scripts/log_files.py
-
curl -L -o log_files.py https://huggingface.co/datasets/pebxcvi/PSHomeCacheDepot/resolve/main/OBJECTS-MAPPED/scripts/log_files.py
813 Bytes
| import os | |
| def log_zip_files(root_folder, output_file): | |
| with open(output_file, "w", encoding="utf-8") as f: | |
| for dirpath, dirnames, filenames in os.walk(root_folder): | |
| for file in filenames: | |
| if file.lower().endswith(".zip"): | |
| file_name_without_ext, _ = os.path.splitext(file) | |
| f.write(file_name_without_ext + "\n") | |
| if __name__ == "__main__": | |
| script_folder = os.path.dirname(os.path.abspath(__file__)) | |
| objects_mapped_folder = os.path.dirname(script_folder) | |
| root_folder = objects_mapped_folder | |
| output_file = os.path.join(objects_mapped_folder, "log.txt") | |
| log_zip_files(root_folder, output_file) | |
| print(f"ZIP file names without extension logged in:") | |
| print(output_file) | |
| input("\nPress Enter to exit...") |