Answers for "python extract directory from filename"

0

Extract filename from path in Python

filename = os.path.basename("path/to/file/sample.txt")
Posted by: Guest on August-31-2021
0

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
Posted by: Guest on January-21-2021

Code answers related to "python extract directory from filename"

Python Answers by Framework

Browse Popular Code Answers by Language