Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to extract a folder using python

pip install patool
import patoolib

#case 1 specific output path
patoolib.extract_archive("filename.rar", outdir="outputpath")

#case 2 current working directory
patoolib.extract_archive("filename.rar")

Comment

extract directory python

import zipfile
inpath = MyDirPath
outpath = inpath.replace(".zip", "") # Remove zip extension so that outpath does not have .zip
        with zipfile.ZipFile(inpath, 'r') as z:
            z.extractall(outpath) # Extracts
Comment

PREVIOUS NEXT
Code Example
Python :: dm command in discord.py 
Python :: recursion in python 
Python :: python compiler online 
Python :: char list python 
Python :: one-hot encode categorical variables standardize numerical variables 
Python :: reverse a list in python 
Python :: python create null matrix 
Python :: python string first letter uppercase and second letter in lowercase 
Python :: how to get all values from class in python 
Python :: python - convert a list column into miltiple columns 
Python :: net way to print 2d array 
Python :: python destructuring 
Python :: python message 
Python :: python find closest date 
Python :: Encrypting a message in Python 
Python :: tree implementation in python 
Python :: dataframe select row by index value 
Python :: django button 
Python :: Function to plot as many bars as you wish 
Python :: How to clone or copy a list in python 
Python :: django create multiple objects 
Python :: python re.split() 
Python :: kaspersky 
Python :: django url with slug 
Python :: python alphanum 
Python :: convert ipynb to py 
Python :: interviewbit with Python questions solutions 
Python :: Python NumPy delete Function Example 
Python :: python variables and data types 
Python :: python shift number 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =