Download OBJECTS-MAPPED/log_files.py from pebxcvi/PSHomeCacheDepot: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/datasets/pebxcvi/PSHomeCacheDepot/resolve/c7e5147d4bcd9307496297caec96782686eed17a/OBJECTS-MAPPED/log_files.py
- Command line
-
hf download hf://datasets/pebxcvi/PSHomeCacheDepot@c7e5147d4bcd9307496297caec96782686eed17a/OBJECTS-MAPPED/log_files.py
-
curl -L -o log_files.py https://huggingface.co/datasets/pebxcvi/PSHomeCacheDepot/resolve/c7e5147d4bcd9307496297caec96782686eed17a/OBJECTS-MAPPED/log_files.py
1.37 kB
| import os | |
| def log_zip_files(root_folder, output_file): | |
| with open(output_file, "w") as f: | |
| for dirpath, dirnames, filenames in os.walk(root_folder): | |
| for file in filenames: | |
| if file.lower().endswith(".zip"): | |
| # Write only the file name (not the full path) | |
| f.write(file + "\n") | |
| if __name__ == "__main__": | |
| # Set the directory you want to start searching from; here it's the current directory | |
| root_folder = "." | |
| output_file = "zip_files.txt" | |
| log_zip_files(root_folder, output_file) | |
| print(f"ZIP file names logged in '{output_file}'.") | |
| import os | |
| def log_zip_files(root_folder, output_file): | |
| with open(output_file, "w") as f: | |
| for dirpath, dirnames, filenames in os.walk(root_folder): | |
| for file in filenames: | |
| if file.lower().endswith(".zip"): | |
| # Remove the .zip extension and write only the file name | |
| file_name_without_ext, _ = os.path.splitext(file) | |
| f.write(file_name_without_ext + "\n") | |
| if __name__ == "__main__": | |
| # Set the directory you want to start searching from; here it's the current directory | |
| root_folder = "." | |
| output_file = "zip_files.txt" | |
| log_zip_files(root_folder, output_file) | |
| print(f"ZIP file names without extension logged in '{output_file}'.") | |