Download construction.py from botbw/tmp: direct link, hf CLI and curl.
- Browser
- Download file 534 Bytes
-
https://huggingface.co/datasets/botbw/tmp/resolve/main/construction.py
- Command line
-
hf download hf://datasets/botbw/tmp/construction.py
-
curl -L -o construction.py https://huggingface.co/datasets/botbw/tmp/resolve/main/construction.py
534 Bytes
| import glob | |
| import binascii | |
| filename = 'result.zip' | |
| with open(filename, 'rb') as f: | |
| content = f.read() | |
| hex = str(binascii.hexlify(content)) | |
| sz = len(hex) | |
| step = 10 | |
| for i in range(step): | |
| with open(f"out-{i}.txt", "w") as f: | |
| f.write(hex[sz//step * i: min(sz//step * (i + 1), sz)]) | |
| construct = "" | |
| for f in sorted(glob.glob("tmp/out*")): | |
| with open(f, 'r') as inf: | |
| construct += inf.read() | |
| bytes = binascii.unhexlify(construct[2:-1]) | |
| with open("constuction.zip", 'wb') as f: | |
| f.write(bytes) |