python extract folder name from path code example
Example: 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