Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python tar a directory

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 :: concatenate 2 array numpy 
Python :: urllib urlretrieve python 3 
Python :: after groupby how to add values in two rows to a list 
Python :: pandas distinct 
Python :: set seed train test split 
Python :: clamp number in python 
Python :: lasso regression implementation python 
Python :: pandas count rows in column 
Python :: django content type 
Python :: subprocess.check_output python 
Python :: python file.write is not writing whole line 
Python :: axios django 
Python :: ipywidget datepicker 
Python :: create an array of n same value python 
Python :: find duplicates in python list 
Python :: find substr within a str in python 
Python :: convert list to generator python 
Python :: django month name from month number 
Python :: python curve fitting 
Python :: check if a the time is 24 hours older python 
Python :: python ssh into server 
Python :: tkinter slider 
Python :: flask error 
Python :: exit python terminal 
Python :: how to custom page not found in django 
Python :: python timer decorator 
Python :: calculate the same value in list i python 
Python :: dataframe plot histogram 
Python :: count of datatypes in columns 
Python :: convert list to nd array 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =