Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

compress tarfile python

import tarfile
import os.path

def make_tarfile(output_filename, source_dir):
    with tarfile.open(output_filename, "w:gz") as tar:
        tar.add(source_dir, arcname=os.path.basename(source_dir))
Comment

PREVIOUS NEXT
Code Example
Python :: duplicate data in python 
Python :: python proxy scraper 
Python :: pandas convert entries in a column after groupby in list 
Python :: delete n from textpython 
Python :: python pyqt5 sleep 
Python :: skip error python 
Python :: pandas dataframe to parquet s3 
Python :: sort list by key 
Python :: random string generate python of 2.7 
Python :: initialize dictionary to zero in python 
Python :: import os 
Python :: python name input 
Python :: python count empty lines in text file 
Python :: how to clean environment python 
Python :: display values on top of seaborn bar plot 
Python :: numpy euclidean distance 
Python :: create a generator from a list 
Python :: how to skip next 5 iteration in python 
Python :: file searching in python 
Python :: python get file path 
Python :: convert string of list to list python 
Python :: python string to datetime object 
Python :: handle errors in flask 
Python :: django app 
Python :: how to do a foreach loop in python 
Python :: Get all the numerical column from the dataframe using python 
Python :: how to use elif in python 
Python :: read a csv and plot in python 
Python :: shutdown flask server with request 
Python :: Sum values of column based on the unique values of another column 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =