python tar怎么安装
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')
赞0
踩0