Код: Выделить всё
from compression import zstd
from pathlib import Path
import shutil
outDir = r"E:\Personal Projects\tmp"
outDir = Path(outDir)
inTar = outDir / "chunk_0.tar"
zstdDir = outDir / "chunk_0.tar.zst"
with open(inTar, 'rb') as f:
with zstd.open(zstdDir, 'wb') as g:
shutil.copyfileobj(f, g)
К сожалению, в документации нет примеров моего использования.
Подробнее здесь: https://stackoverflow.com/questions/798 ... eaded-mode
Мобильная версия