for folder in path python code example
Example 1: python os get dir path
from os import getcwd # only import "getcwd" from os
getcwd() # Get the current working directory
Example 2: 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