pip install funfile
from funfile import tarfile
# 压缩
with tarfile.open("results.tar", "w|xz") as tar:
tar.add("a.txt")
# 解压
with tarfile.open("results.tar", "r|xz") as tar:
tar.extractall("local")
from funfile import ConcurrentFile
with ConcurrentFile("a.txt", mode='w') as fw:
fw.write("hello,funfile.")