.tar.gz海量遥感影像解压

import tarfile
import os
def tar(fname):
    t = tarfile.open(fname + ".tar.gz", "w:gz")
    for root, dir, files in os.walk(fname):
        print root, dir, files
        for file in files:
            fullpath = os.path.join(root, file)
            t.add(fullpath)
    t.close()

if __name__ == "__main__":
    tar("del")

 

posted @ 2020-12-24 08:38  木易GIS  阅读(179)  评论(0编辑  收藏  举报