Spaces:
Paused
Paused
Create unzip_docs.py
Browse files- unzip_docs.py +11 -0
unzip_docs.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import zipfile, pathlib, shutil
|
| 2 |
+
|
| 3 |
+
ZIP_PATH = pathlib.Path("docs_txt.zip")
|
| 4 |
+
OUT_DIR = pathlib.Path("docs_txt")
|
| 5 |
+
if not ZIP_PATH.exists():
|
| 6 |
+
raise SystemExit("Архив docs_txt.zip не найден.")
|
| 7 |
+
if OUT_DIR.exists():
|
| 8 |
+
shutil.rmtree(OUT_DIR) # чистим старую распаковку
|
| 9 |
+
with zipfile.ZipFile(ZIP_PATH, "r") as z:
|
| 10 |
+
z.extractall(OUT_DIR)
|
| 11 |
+
print("✓ Файлы распакованы в", OUT_DIR)
|