#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import tarfile
import progressbar
import ConfigParser

#config
config = ConfigParser.ConfigParser()
config.read('config.conf')
infile = config.get('in','infile')
outfile= config.get('out','outfile')

#tar, progressbar

tar = tarfile.open(outfile,"w|gz")
tar.add(infile)
tar.close()

bar = progressbar.ProgressBar(widgets=['Архивация файла: ',
                  progressbar.Bar(left='[', marker='=', right='] '),
                  progressbar.Percentage()]).start()

tar = tarfile.open(outfile,"w|gz")
tar.add(infile)
tar.close()

bar.finish()

Add a code snippet to your website: www.paste.org