extract.py 191 B

123456789
  1. import sys
  2. import tarfile
  3. import os
  4. tarball = os.path.abspath(sys.argv[1])
  5. dirname = os.path.abspath(sys.argv[2])
  6. tfile = tarfile.open(tarball,'r:gz');
  7. tfile.extractall(dirname)
  8. sys.exit(0)